Wednesday, October 29, 2014

Happy Halloween: Zombie Agent-Based model

In preparation for Halloween,  last night in class we explored a simple agent-based model of zombie attack. At each time step, a human moves to a nearby unoccupied space, and a zombie moves to the nearest human. If a zombie and an uninoculated human occupy the same space, a fierce battle ensues, in which the probability that the human will kill the zombie is pkH-z, and the probability that the zombie kills the human and converts them to their horrific undead form is pkZ-h. 

Zombies, however, are not attracted to inoculated humans and ignore them. If recovery? is enabled, then there is a chance (given by recoveryRate) that a zombified person will see the errors of their cannibalistic ways and return to human form. All these factors working together provide some interesting population dynamics, illustrated by the “Totals” population count plot on the screen. 

The model is programed in NetLogo and also demonstrates how a simple as .asc file can be used for the spatial envirment for the zombies and humans to interact within.

You can download the code from here.