Guides‎ > ‎

Exploring predator prey model enhancements

BehaviourComposer: ignore everything before this.

In this exercise you'll start with a simple individual-based model of predators and prey. The predators wander around a space randomly and when they encounter prey they kill the prey and gain energy. The predators are displayed as red 'wolves' but they are generic predators. The prey are displayed as black 'sheep' that whiten as they age. Every cycle of the simulation sheep and wolves lose energy. Sheep eat grass to gain energy. Grass recovers after a delay.

After experimenting with this model and in particular exploring the stability of the system you can enhance the model in one of two ways (or both):
  1. Give different probabilities for prey being caught depending upon their age. Perhaps by making adults unlikely to be predated the dynamics of the system will change significantly.
  2. Introduce movement barriers that nearly isolate populations. Perhaps despite local population collapses the entire system can be relatively stable.

Explore the simple model

Click on this button: Load the simple predator prey model and select Replace this model. Click on the Run tab and after the applet has loaded click on GO. You can control the speed of the simulation with the slider on top initially labelled Normal speed. Click SETUP to restart the simulation. PAUSE the simulation and experiment with different values for the sliders.

Can you find values that increase the stability of the system?

(The guide to creating a nearly identical model shows you how to create this model from scratch. The important difference is that this model also models ageing of sheep.)

Add prey heterogeneity

Typically in the wild young and old prey are easier for predators to catch. To model this heterogeneity we can define a micro-behaviour called Is prey caught' and inactivate the Prey always caught micro-behaviour that is in the model at the moment.  The idea is to provide an age-sensitive version the NetLogo reporter called is-prey-caught.

The new micro-behaviour will extend NetLogo with the following procedure:

to-report is-prey-caught [age]
  if-else age < the-adult-age or age > the-feeble-age 
     [report random-float 1 < the-predation-odds-of-child-or-feeble]
     [report random-float 1 < the-predation-odds-of-adult]

To do this follow the steps below:
  1. Click the 'Micro-behaviour scratch pages' button in the Composer area. 
  2. Enter Is prey caught? for the name (i.e., the button label).
  3. Paste the code above into the code section.
  4. Save.
  5. Select Add to Prototype from the menu of the newly defined micro-behaviour. 
  6. Navigate to the prototype labelled Support and click anywhere in that panel. 
  7. Click on Prey always caught (still looking at the Support prototype) and select Inactivate
You should end up with the Support prototype looking like this:

The 'Is prey caught?' behaviour has parameters that need to be defined:
  1. Click on Age of becoming adultAge of becoming feebleOdds of child or feeble predated, and Odds of adult predated in the Parameters list then select Activate
The odds of a predator catching a prey (when it is at the same location) is now determined by the values of two sliders: 
  • the-predation-odds-of-child-or-feeble determines the likelihood that young or old (feeble) prey are eaten by predator.
  • the-predation-odds-of-adult determines the likelihood that prey outside of these vulnerable ages (young and old) are eaten by prey. (An adult is considered anyone whose age is greater than the value of the-adult-age slider but less than the-feeble-age slider.
Open Eat Sheep and add the condition is-prey-caught my-age as follows:

Experiment with the probability sliders to see how they affect the stability of the predator and prey populations.

Add nearly isolating geography

Here we introduce some geographical barriers (perhaps rivers) that predators and prey cannot cross. The barriers have 'holes' in them so that we avoid completely isolating populations. 
  1. Click on Create blue patches and add it to the World prototype (make sure this behaviour is added underneath the 'Color of all patches' micro-behaviour). 
  2. Click on Turn around and back out if blue and add it to either or both of the Sheep and Wolf prototypes depending whether you want the barriers to apply to both predator and prey. 
  3. In order to observe whether the different regions have different population cycles add Plot left wolvesPlot right wolvesPlot left sheepPlot right sheep to the Observer prototype and inactivate Plot wolves and Plot Sheep. Now the graphs will distinguish between those left of the 'river' and those right of it. 

Experiment with the resulting model.

BehaviourComposer: ignore everything after this.

Ken Kahn,
13 Feb 2017, 01:12
Ken Kahn,
13 Feb 2017, 01:07