cellular automata
i'm a bit obsessed with cellular automata, give a grid of cells a few simple rules and you can lose hours watching what happens. my 2017 dissertation at southampton was on modelling slime mould in java, looking at how local interactions turn into networks and what happens when you make two colonies compete. this is mostly an excuse to keep messing around with that stuff.
this is the one from my dissertation. lots of tiny cells sensing food and following trails, with no idea what the whole colony is doing. somehow you get a network out of that. still quite happy to sit and watch it.
the one i always come back to. a cell only gets to know about its eight neighbours, and that's enough for gliders, clocks and things that build more things. try acorn. seven cells, then a surprisingly long wait.
life with a short memory, sort of. a cell fires, has a little rest, then can fire again. that one extra state gives you these lovely little machines that seem to run across the grid. draw something in their way.
every colour eats the next one, all the way round. nobody gets to win. it starts as noise and ends up full of spirals, which feels like quite a lot of organisation for such a petty little rule.
a cell gets excited by its neighbours, then needs time to recover. think waves rather than little creatures. cut a travelling wave in half and watch the loose ends. this is the sort of local interaction that got me into all this.
two imaginary chemicals spreading out and reacting. change the rates a tiny bit and spots turn into worms, or something that looks vaguely alive. same interest as the slime work: where does the apparent organisation come from?
the baseline from 2017. try putting food in a few places, then a wall between them. the cells only sense what's nearby; the paths are the colony figuring it out collectively.
what if the food is easier to find? this was one of the changes i investigated. switch to food sensing to see the wider signal, then compare the trails with the local model.
two colonies, shared food, and a reason to avoid each other. another experiment from the dissertation. there isn't a little manager dividing up the board. the warm and cool trails just get there through local decisions.
an earlier, looser sketch. these agents can overlap and wrap around the edges, unlike the dissertation model. useful for seeing how much those seemingly small choices change the result.
drag to draw; shift or right-drag to erase. wheel to zoom. middle-drag or the pan tool to move. space pauses when the canvas is focused.
what am i looking at?
b is how many neighbours a dead cell needs to be born; s is how many a live one needs to stick around. all eight surrounding cells count, and everyone updates together. change one number and a familiar little creature can stop working entirely.
try the r-pentomino or acorn one step at a time. the replicator needs highlife; the gun and glider want conway's rule. wrap joins opposite edges. turn it off to give the board an actual edge.
three states: ready, firing, recovering. exactly two firing neighbours wake a ready cell up. it fires for one tick, recovers for one, then is ready again. that's the whole rule. the moving things are what happens when you repeat it.
each state is chased by the next, with the last chased by the first. a cell changes when enough of its eight neighbours are in the next state. try changing the threshold from one to two, or give it fewer colours. the edges wrap.
a resting cell fires when enough neighbours are firing, then works through a fixed recovery cycle. this is a greenberg–hastings variant using all eight neighbours. the colours show how far through recovery each cell is. the edges wrap.
erase a gap in a travelling wave and see whether its ends curl. more states means a longer recovery.
these cells hold concentrations rather than being on or off. u gets replenished; v consumes u and decays. both diffuse. drawing adds v, erasing restores u. the recipe menu is a good place to start before fiddling with feed and kill. up to eight integration steps run per tick; the edges wrap.
Du = 1, Dv = 0.5, dt = 1. The nine-point Laplacian uses 0.2 for cardinal neighbours and 0.05 for diagonals.
i built the original model in java for my computer science dissertation at southampton in 2017. this rebuild follows the sensor geometry, separate food field, collision checks and gaussian diffusion described in the report.
- local food: short-range food cues, as in the baseline model.
- long-range sensing: a wider food field. try the food sensing view to see what the cells can pick up.
- competition: two colonies follow their own trails and avoid the other colony's trails. food is shared. warm and cool colours distinguish the colonies.
cells use eight compass directions and three 3×3 sensor patches. with no signal they turn randomly. occupied cells block movement. the sensor distance of 8 and angle of 45° come from the report's final parameter selection. diffusion uses the 3×3 gaussian kernel shown there: centre 1/4, cardinal neighbours 1/8, diagonals 1/16, followed by trail decay.
the board has closed edges; diffusion reflects at the outer boundary. food doesn't run out, and the long-range food field is a gaussian approximation. walls remove any cells painted over and block movement, but food sensing can extend through them. cell count is capped at the number of grid spaces.
the pdf includes a sensor-code excerpt, not the full java project. this is an adaptation, not a line-for-line port or a reproduction of the results. the earlier trail sketch is still here for comparison: that one uses continuous headings, wrapping edges and no collision exclusion.
source: modelling the emergent behaviours of slime mould and investigating modifications of the model, 2017, pp. 9–18 and 24–27. the original work builds on jeff jones' particle models.