Building simulations with a Go cellular automata framework

How to build simulations using Petri, a Go framework for creating cellular automata

Sau Sheong
The Startup
Published in
11 min readMar 17, 2020

--

I have been fiddling around with simulations in the past couple of months, simulating cultural disseminations with Axelrod’s model and the spread of epidemics as well. I built the models and created the simulations using Go and inevitably ended up with quite a bit of common code in both.

So it’s only natural to take the code that is common in both simulations and making it re-usable for other types of simulations as well. In other words, creating a framework. As the simulations I did created previously are based on a grid of cells, it’s also natural that it ended up as a cellular automata framework.

Cellular automata

Cellular automata (singular is cellular automaton) is a kind of model and simulation, consisting of a grid of cells. If you have gone through any form of Computer Science education at a point in your life you would have likely encountered it through the popular Conway’s Game of Life (though some of my more junior colleagues told me they didn’t).

Cellular automata were invented by Stanislaw Ulam and John von Neumann in the late 1940s. von Neumann originally proposed the idea of an ‘automaton’ (the word means a machine that can act independently), and one of the questions he was concerned with was whether it is possible for a machine (or automaton) to…

--

--