3 min read

Sweet Sweet Simulations

Errata

In last week’s newsletter I incorrectly identified Epstein and Axtell’s simulation. It’s called Sugarscape, not Sugarland. My apologies.

Sugarscape Resources

As I mentioned in last week’s newsletter, I’ve been reading Growing Artificial Societies by Joshua M. Epstein and Robert Axtell. The book is only available in dead tree format, and the code that shipped on a CD is quite old at this point. The good news is that there are numerous resources online.

There is a lecture by author Joshua Epstein on “The philosophy and applications of agent-based computational modeling” available on Youtube. The lecture is a general discussion on using agent-based simulations to explain systems and predict outcomes. It is interesting how many applications there are for these kinds of simulations; they apply to all sorts of domains.

The University of California, Davis course on computer simulations covers the Sugarscape simulation as implemented in NetLogo.

Better yet, you can play with Sugarscape yourself if you download NetLogo. The basic simulation is included in the download. If you want to play with the version that introduces trade, Sugarscape with Spice is available in the CoMSES Computational Model Library.

Exploring the Sugarscape

I spent some time playing with Sugarscape with Spice last week. First I experimented with changing the parameters that are exposed in the GUI, changing the starting population and amount of resources available. Then I poked at the code, changing the logic that controlled the metabolism and vision range of the Sugarscape citizens (or “turtles” as NetLogo calls individual cells).

Sugarscape reminds me of Conway’s Game of Life. It’s not just the two dimensional grid with colored blocks (although that certainly invites the comparison). It’s the idea of an agent being born, living, and dying, and the opportunity to observe the larger patterns within the system. So I also spent some time playing with an online implementation of Game of Life.

As I played with both simulations this week, I tried to find ways to change the outcome. The rules for Conway’s Game of Life are much simpler than Sugarscape: there is only life and death. But in both Game of Life and Sugarscape, the system often settles into a stable state where the population remains at a given level. In the case of Sugarscape, the resources, trades, and trade price also tend to stabilize. Could I change the starting conditions in ways that would shift the homeostasis points?

First, I tried to find ways to maximize the population growth. In the Game of Life I tried different starting patterns, experimenting with conditions that lead to unbounded growth. In Sugarscape with Spice, I experimented with providing more resources, a larger and smaller starting population, and lowering the barrier to reproduction. I discovered that if I set the “wealth-reproduction” parameter to zero, the system would appear to stabilize but then would begin wild population fluctuations that seemed to continue indefinitely. Trade prices mostly hovered at zero but then burst up to stratospheric heights. I don’t know enough to draw any conclusions from these observations, but it was fascinating to watch.

Next I tried to find ways to make the population crash. It’s all too easy in The Game of Life to set conditions that result in extinction. In Sugarscape, eliminating the logic that regenerated resources worked remarkably well for annihilating the agents. However short of changing the code in ways that fundamentally changed the simulation (like making the resources non-renewable) I found it difficult to cause a catastrophic population decline.

The Game of Life and Sugarscape are examples of a different kind of simulation than the software development simulation I’ve been working on. Yet understanding more about how cellular automata (Game of Life) and agent-based models (Sugarscape) work is inspiring me to look at the software development simulation in new ways. I’m not sure what will come of that yet, but I’m certainly glad I took a detour to play last week.

This week I’m returning the software development simulation. Now that the metrics code is in better shape I expect to start working on visualizations soon. Perhaps by the next newsletter I will have something you can actually see. In the meantime, I hope you’ll enjoy playing with NetLogo as much as I did.

Stay curious,

Elisabeth