A first stab at gene expression

In the last post I talked a bit about how I might approach expressing genes in SnailLife Go, and how this worked in the PHP prototype of the simulation. I gave a rough example of how I’m thinking of handling gene expression - via “expresser” interfaces that organs are to implement. I got as far as having my outer shell organ implement SizeA1Expresser, but nothing actually happened yet. Something happens now.

Continue Reading »

Brainstorming the SnailLife gene system

In the original PHP prototype of SnailLife there exists a very rudimentary genetics system. Snails had what I called “visual traits” and “functional traits”. Visual traits had genes associated with them. The genes were all stored in the snail’s table and each gene had two “alleles”. During breeding I’d make virtual Punnett Squares of sorts to pass on genes from parents to offspring. But the system was inflexible - each allele for each gene and each gene type were hard coded in the snails table.

Continue Reading »

Are YOU experiencing shady output from your Go debugger? Try these things!

A couple of days ago I noticed some unreliable output when stepping through the SnailLife server. I use GoLand and Delve debugger, but in the course of looking into this I picked up some tips from trial and error plus from some very helpful people which I think might be useful regardless of the debugger you use. First, the repro. Fedora 28 Go version 1.11 rc1 Delve version 1.

Continue Reading »

Roee: Self Modifying Go Simulation Experiment - Part 2

<– PART ONE Overview ORM Intentionaliser aggregationObserver aggregationReifier aggregationModifier The new type Qualifier Recompiling and restarting Visualizing the results Conclusion Overview In Part 1 we talked about the general setup of the world/grid and what the Agent and Instructions metamodels do. We left off at the part where the grid sends a copy of itself to whatever observer channels it has (currently just the aggregationObserver).

Continue Reading »

Roee: Self Modifying Go Simulation Experiment - Part 1

Intro ORM Intentionaliser Questions Self-modifying simulation in Go? What are we bootstrapping? Vague definitions and bad practices The world Instructions Running the World PART TWO –> Intro I took up a small pet project over summer that I called Roee. It was very loosely based on a paper I’d read by Susan Stepney and Tim Hoverd, Reflecting on Open Ended Evolution. I also had the opportunity to hear Susan Stepney talk about this paper in person at ECAL 2017 (but didn’t actually go back to read it until this June).

Continue Reading »

Quick and Dirty Function Timing in Go

When I want to do some rough timing comparisons or get a quick idea of what part of Thing X is taking so long I sometimes just time a few functions. I used to do this by getting st := time.Now() at the beginning of the function and then time.Since(st) at the end. It recently hit me that the same thing could be achieved with less duplication and messiness to clean up (when removing the timings) with something like this:

Continue Reading »

Rubber Ducky Moments: 'Completely unrelated []interface{}!!!'

I mentioned on Twitter earlier today that very often when I get really stuck on something and finally decide to ask for help on a forum, the answer suddenly hits me as I finish writing my post. Most of the time the problem is something really silly that I just kept completely overlooking, and the answer feels painfully obvious once it clicks. Despite the fact that these might be a little embarrassing to post, I figured rather than letting my entire would-be forum post go to total waste once I finally get what’s happening (and so never end up clicking the “Post” button), it might be nice to post the issue on my blog, if nothing else as a reminder of my own facepalm moments.

Continue Reading »

go-sql-driver and MySQL 8

I should know better than to use a latest tag in a Docker image. I’d never do this at work, so why did I do it in my hobby project? I blame Go’s nature of dealing with package versioning (that is, the lack thereof) for putting me in the “let’s use latest!” mindset (and yes I know they’re working on it). Anyway, I should know better, but here we are, writing this post.

Continue Reading »

Some SnailLife Go client testing notes

I’ve started working on client tests, which have been getting very neglected compared to the server. I figured I’d write some quick notes on what I’ve done so far before continuing, before I forget. The first thing I’m choosing to focus on testing is interaction with the server. I’m already testing my API on the server side, but I also want to make sure I’m sending correct requests and handling responses correctly from the client.

Continue Reading »

Testing SnailLife Go repositories

Every SnailLife model struct has a repository struct to go with it. Since all repos are implementing the same Repository interface I wanted to reuse most of the code for testing them, but also allow for custom repo-specific tests. For example,OwnerRepo does some stuff that StableRepo does not - like optionally retrieving stables belonging to an owner. For now I am going about it as follows, but any feedback or suggestions for a better way are more than welcome.

Continue Reading »