NetLogo encourages the development of entity-based or agent-based models. Many of the systems for which NetLogo models are popular have also been modeled with alternative methods, such as systems of differential equations. The differences between these broad classes of techniques are non-trivial and of great importance to practicing modelers (Parunak et al. 1998).

This model illustrates one such difference, identified by Shnerb et al. 2000. They present a simple scenario consisting of two interacting populations.

* Immortals are never born and never die. They move by diffusion (modeled in NetLogo by invoking DOWNHILL on their concentration) at a velocity specified by IMMORTALS-DIFFUSION.

* Mortals die, are born, and move. Their movement is by diffusion (driven by the concentration of other mortals). The probability that a mortal will die at a given time step is MORTALS-DEATH-RATE (expressed as 100 * the probability). Birth requires the presence of an immortal on the same patch. The probability that a mortal occupying a patch with an immortal will reproduce is given by MORTALS-BIRTH-RATE.

The differential equations capturing this behavior are quite simple. Their solution predicts that the long-term population of mortals will grow without limit if MORTALS-BIRTH-RATE * the density of the immortal population is greater than MORTALS-DEATH-RATE, and go to zero if the product is less than the death rate.

Shnerb et al. observe that this prediction is sometimes violated by an agent-based model of the same scenario. The reason is that the distribution of agents is not homogeneous. New mortals are not randomly distributed over the territory, but are born in the vicinity of their "father" immortals, and thus have a higher chance to encounter an immortal (namely, their father) than the mean field approximation would suggest. I built this model to see how robust this effect is and gain experience with its dynamics.

## HOW TO USE IT

1. Adjust the slider parameters (see below), or use the default settings. 2. Press the SETUP button. 3. Press the GO button to begin the simulation. 4. View the POPULATIONS plot to watch the populations fluctuate over time 5. The BALANCE window shows the difference (BIRTH-RATE * IMMORTAL-DENSITY) - DEATH-RATE. The equation-based mean-field theory predicts that the population should grow if this is positive and go to zero if it is negative.

Parameters (all probabilities are expressed as whole-number percentages, and compared with random-int-or-float 100 to make decisions) BACKGROUND-COLOR: Default is black, but on some screens, the blue turtles (mortals) may be hard to see, so you can use this slider to adjust the background. INIT-MORTALS: The initial size of the population of mortals (default 250) INIT-IMMORTALS: The (constant) size of the population of immortals (default 50) MORTALS-DIFFUSION: The probability that a mortal will move a step on a given round (thus approximates velocity in patches-per-step) (default 25) IMMORTALS-DIFFUSION: The probability that an immortal will move a step on a given round (thus approximates velocity in patches-per-step) (default 14) MORTALS-DEATH-RATE: The probability that a mortal will die on a given step (default 15) MORTALS-BIRTH-RATE: The probability that a mortal sharing a patch with an immortal will give birth on a given step (default 85) UPPER-THRESHOLD: If the LIMIT-MORTALS switch is on, the model will stop when the mortal population reaches this level, making it easier to count runs at different population levels (see below).

## THINGS TO NOTICE

The default settings give a balance of -14, predicting extinction, but in many runs the population of mortals explodes.

In other runs for the same balance, the population collapses. You may need to press SETUP several times before finding an initial distribution of agents that permits the explosion of mortals.

Explosion is not necessarily monotonic. The population of mortals can grow very large (10,000 or more, in which case the model slows down significantly!), and yet subsequently collapse.

## THINGS TO TRY

Try adjusting the parameters under various settings. How sensitive is the stability of the model to the particular parameters?

You might count the proportion of setups that permit the population of mortals to grow to a certain threshold, as a function of the balance. What is the shape of this curve?

How does diffusion speed affect the likelihood of a boom in mortals?

## EXTENDING THE MODEL

What happens if we introduce a gestation period, by requiring a certain number of time steps to pass between a meeting between a mortal and an immortal, and the birth of the new mortal?

What if new mortals are not born in the vicinity of their parents, but rather are assigned to a random location in the terrain?

What happens if we make the immortals mortal?

## NETLOGO FEATURES

Note the use of breeds to model two different kinds of "turtles": mortals and immortals.

DOWNHILL is a very easy way to model diffusion. (It would be nice to have a version of this primitive that makes the movement decision, not deterministically, but stochastically, selecting direction based on a roulette wheel whose segments are sized according to some function of the density to which DOWNHILL is responding.)

## RELATED MODELS

This model was constructed by beginning with the Wolf-Sheep predation model in the NetLogo distribution (Wilensky 1998), and retains much of its structure for dealing with interacting populations. (The logic is, of course, quite different.)