Home Download Help Resources Extensions FAQ NetLogo Publications Contact Us Donate Models: Library Community Modeling Commons Beginners Interactive NetLogo Dictionary User Manuals: Web Printable Chinese Czech Farsi / Persian Japanese Spanish

NetLogo Models Library: 
If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web 
This model explores the stability of predatorprey ecosystems. Such a system is called unstable if it tends to result in extinction for one or more species involved. In contrast, a system is stable if it tends to maintain itself over time, despite fluctuations in population sizes.
There are two main variations to this model.
In the first variation, the "sheepwolves" version, wolves and sheep wander randomly around the landscape, while the wolves look for sheep to prey on. Each step costs the wolves energy, and they must eat sheep in order to replenish their energy  when they run out of energy they die. To allow the population to continue, each wolf or sheep has a fixed probability of reproducing at each time step. In this variation, we model the grass as "infinite" so that sheep always have enough to eat, and we don't explicitly model the eating or growing of grass. As such, sheep don't either gain or lose energy by eating or moving. This variation produces interesting population dynamics, but is ultimately unstable. This variation of the model is particularly wellsuited to interacting species in a rich nutrient environment, such as two strains of bacteria in a petri dish (Gause, 1934).
The second variation, the "sheepwolvesgrass" version explictly models grass (green) in addition to wolves and sheep. The behavior of the wolves is identical to the first variation, however this time the sheep must eat grass in order to maintain their energy  when they run out of energy they die. Once grass is eaten it will only regrow after a fixed amount of time. This variation is more complex than the first, but it is generally stable. It is a closer match to the classic Lotka Volterra population oscillation models. The classic LV models though assume the populations can take on real values, but in small populations these models underestimate extinctions and agentbased models such as the ones here, provide more realistic results. (See Wilensky & Rand, 2015; chapter 4).
The construction of this model is described in two papers by Wilensky & Reisman (1998; 2006) referenced below.
Parameters: MODELVERSION: Whether we model sheep wolves and grass or just sheep and wolves INITIALNUMBERSHEEP: The initial size of sheep population INITIALNUMBERWOLVES: The initial size of wolf population SHEEPGAINFROMFOOD: The amount of energy sheep get for every grass patch eaten (Note this is not used in the sheepwolves model version) WOLFGAINFROMFOOD: The amount of energy wolves get for every sheep eaten SHEEPREPRODUCE: The probability of a sheep reproducing at each time step WOLFREPRODUCE: The probability of a wolf reproducing at each time step GRASSREGROWTHTIME: How long it takes for grass to regrow once it is eaten (Note this is not used in the sheepwolves model version) SHOWENERGY?: Whether or not to show the energy of each animal as a number
Notes:  one unit of energy is deducted for every step a wolf takes  when running the sheepwolvesgrass model version, one unit of energy is deducted for every step a sheep takes
There are three monitors to show the populations of the wolves, sheep and grass and a populations plot to display the population values over time.
If there are no wolves left and too many sheep, the model run stops.
When running the sheepwolves model variation, watch as the sheep and wolf populations fluctuate. Notice that increases and decreases in the sizes of each population are related. In what way are they related? What eventually happens?
In the sheepwolvesgrass model variation, notice the green line added to the population plot representing fluctuations in the amount of grass. How do the sizes of the three populations appear to relate now? What is the explanation for this?
Why do you suppose that some variations of the model might be stable while others are not?
Try adjusting the parameters under various settings. How sensitive is the stability of the model to the particular parameters?
Can you find any parameters that generate a stable ecosystem in the sheepwolves model variation?
Try running the sheepwolvesgrass model variation, but setting INITIALNUMBERWOLVES to 0. This gives a stable ecosystem with only sheep and grass. Why might this be stable while the variation with only sheep and wolves is not?
Notice that under stable settings, the populations tend to fluctuate at a predictable pace. Can you find any parameters that will speed this up or slow it down?
There are a number ways to alter the model so that it will be stable with only wolves and sheep (no grass). Some will require new elements to be coded in or existing behaviors to be changed. Can you develop such a version?
Try changing the reproduction rules  for example, what would happen if reproduction depended on energy rather than being determined by a fixed probability?
Can you modify the model so the sheep will flock?
Can you modify the model so that wolves actively chase sheep?
Note the use of breeds to model two different kinds of "turtles": wolves and sheep. Note the use of patches to model grass.
Note use of the ONEOF agentset reporter to select a random sheep to be eaten by a wolf.
Look at Rabbits Grass Weeds for another model of interacting populations with different rules.
Wilensky, U. & Reisman, K. (1998). Connected Science: Learning Biology through Constructing and Testing Computational Theories  an Embodied Modeling Approach. International Journal of Complex Systems, M. 234, pp. 1  12. (The WolfSheepPredation model is a slightly extended version of the model described in the paper.)
Wilensky, U. & Reisman, K. (2006). Thinking like a Wolf, a Sheep or a Firefly: Learning Biology through Constructing and Testing Computational Theories  an Embodied Modeling Approach. Cognition & Instruction, 24(2), pp. 171209. http://ccl.northwestern.edu/papers/wolfsheep.pdf .
Wilensky, U., & Rand, W. (2015). An introduction to agentbased modeling: Modeling natural, social and engineered complex systems with NetLogo. Cambridge, MA: MIT Press.
Lotka, A. J. (1925). Elements of physical biology. New York: Dover.
Volterra, V. (1926, October 16). Fluctuations in the abundance of a species considered mathematically. Nature, 118, 558–560.
Gause, G. F. (1934). The struggle for existence. Baltimore: Williams & Wilkins.
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself:
Please cite the NetLogo software as:
Copyright 1997 Uri Wilensky.
This work is licensed under the Creative Commons AttributionNonCommercialShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/byncsa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.
This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECTBASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program)  grant numbers RED #9552950 and REC #9632612.
This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORKBASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs)  grant numbers REC #9814682 and REC0126227. Converted from StarLogoT to NetLogo, 2000.
(back to the NetLogo Models Library)