NetLogo banner

 Home
 Download
 Resources
 Extensions
 FAQ
 References
 Contact Us

 Models:
 Library
 Community
 Modeling Commons

 User Manuals:
 Web
 Printable
 Chinese
 Czech
 Japanese

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

ZombieInfection

by Alex Fink (Submitted: 01/23/2006)

[screen shot]

Download ZombieInfection
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

(You can also run this model in your browser, but we don't recommend it; details here.)

WHAT IS IT?

This is a moderately faithful rewrite of Kevan Davis' Zombie Infection Simulation in NetLogo.

Go play with the original model if you haven't yet; a lot of this documentation is a comparison with the original.

HOW IT WORKS

Zombies are green (or gray), move very slowly and change direction randomly and frequently unless they can see something moving in front of them, in which case they start walking towards it. After a while they get bored and wander randomly again.

If a zombie finds a human on the same patch, it infects them; the human immediately joins the ranks of the undead.

Humans are pink (well, magenta) and run five times as fast as zombies, changing direction when they run into a wall. If they see a zombie in front of them, they turn around and panic.

Panicked humans are bright pink and run twice as fast as other humans. If a human sees another panicked human, it starts panicking as well. A panicked human who has seen nothing to panic about for a while will calm down again.

HOW TO USE IT

Press SETUP to create and populate a new city.
Press SETUP-BEINGS to place the beings while retaining the current city.
Press UNINFECT to reduce the number of zombies to NUM-ZOMBIES (this may change some humans to zombies if you have increased NUM-ZOMBIES while running the model).
GO, as usual, runs the model.

Parameters:
NUM-HUMANS: number of humans (only takes effect after SETUP or SETUP-BEINGS)
NUM-ZOMBIES: number of zombies (only takes effect after SETUP or SETUP-BEINGS or UNINFECT)
GREEN-ZOMBIES?: are zombies green? If not, they'll be gray.
WRAP?: does the city wrap around the edges? (only takes effect after SETUP)

SIGNIFICANT DIFFERENCES FROM THE ORIGINAL

The model of space is the standard NetLogo model, in which space and direction are both continuous. Thus, for instance, it's more reasonable for humans to keep
running in straight lines when nothing is in their way; they don't miss entrances to small passages or cluster as much as they would in the discrete grid-based model.

Beings' fields of vision are cones with 45 degree width instead of just the lines directly ahead. These fields of vision go through walls (I guess the beings can hear, or smell, or something).

The city wraps around by default; again, this is more natural in NetLogo than it might be in proce55ing.

Arbitrarily many beings may occupy one patch.

The city is carved out differently: although it has the same general feel, more types of passages can occur, for instance zig-zags:

    *****************
*
*
*
*****************

Beings only look ahead of themselves every fifth time step. This was done to speed the model up, and appears to have no significant effects on the simulation.

THINGS TO NOTICE

Infection takes place much more slowly, in terms of simulation timesteps, than in the original model.

In zombie-dominated areas of the city, the zombies tend to form into lines (in the original model, we instead observe blobs).

THINGS TO TRY

Find the critical population density for panic to be self-sustaining.

Play with NetLogo perspective features like watch and follow.

Resize the city, using the Edit button on the city display. This will probably require adjusting the numbers in the setup-town procedure to get the same overall proportion of open space.

EXTENDING THE MODEL

A number of variants of the Zombie Infection Simulator have already been created (see Kevan's page for links). This model could be extended in any of the same ways:
- Allow humans to fight back; alternatively, create a military breed of humans dedicated to fighting zombies.
- Drop nukes on the city.
- Let zombies break down walls.
etc.

These extensions are more like bug-fixes:
- Ensure that there are no completely isolated spaces without entrances or exits when the city is created.
- Beings like to get stuck in zig-zags in tunnels that are only two or three patches wide. Prevent this from happening.
- Make the walls actually opaque. (This will probably be a mess, since there is no support for this among the NetLogo agentset reporters like in-cone.)

And, of course, it would be nice to make it run faster.

NETLOGO FEATURES

The tunnels in the city are carved by a dedicated breed of turtle (an initial attempt to generate them with patch agentsets proved horribly slow).

I especially like the way beings reorient themselves after hitting a wall -- they can even follow tunnels with no special case movement rules.

Beings never move by more than distance 1 at a time, to prevent them from jumping through walls.

Even though NetLogo supports a full suite of nowrap primitives, I lazily implemented the unwrapped city by simply placing walls around the edges. This means that beings can still see in a wrapped fashion past these walls even when WRAP? is off.

CREDITS AND REFERENCES

Kevan Davis' original Zombie Infection Simulation, version 2.3:
http://kevan.org/proce55ing/zombies/

(back to the NetLogo User Community Models)