coevolution

coevolution preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 241 times • Downloaded 27 times • Run 0 times
Download the 'coevolution' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model simulates the process of coevolution.

HOW IT WORKS

  1. There are prey and predator populations in the model. The population size can be adjusted by the "number-of-prey" and "number-of-predators" sliders. Once the user sets up the population sizes, they remain stable over time. There are three pairs of predator-prey relationships to try.

  2. Each predator will hunt five times each tick. It has to get two successful hunts to survive. In each hunt, users may or may not allow the predators to identify the slowest prey in their hunting range. When "spot-the-slowest-prey" is off, the predator randomly picks one prey. It kills the prey if its speed is higher than that of the prey. When "spot-the-slowest-prey" is on, the predator picks the slowest prey. It kills the prey if its speed is higher than that of this prey.

  3. The prey only dies when it is preyed on by the predators.

  4. In each tick, both populations are re-established based on the survivors. The speed of new prey and predators are around the average speed of the survivors, with some variations determined by the relevant speed mutation.

  5. Mutation of speed for prey or predator can be controlled by the relevant sliders. Note it does not determine the mutation direction but only represents the extent to which the offspring can mutate. So the mutation can lead to either a faster or a slower runner.

  6. Users may add faster or slow prey/predators into the simulation, which are either slower or faster than the min/max speed of the existing prey/predators.

  7. This simulation does not consider the energy cost of prey or predators. The hunting success is solely determined by speed difference.

HOW TO USE IT

  • Press on "set/reset" to set the simulation.
  • Press on "run/pause" to run or pause the simulation.
  • Sliders can be adjusted before and while running the simulation.

THINGS TO TRY

  • Alter the speed mutation of prey and predator to observe the results.
  • Turn on and off predator's ability to spot the slowest prey.

CREDITS AND REFERENCES

This model is made by Dr. Lin Xiang at Weber State University. If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2018). Coevolution. Department of Zoology, Weber State University, Ogden, UT.

CC BY-NC-SA 4.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [prey a-prey]
breed [predators predator]

turtles-own [speed hit erg]
predators-own[keen]

globals[prey-mean-speed predator-mean-speed slowest-prey-speed slowest-predator-speed]

;------

to setup
  ca

  setup-prey
  setup-predators
  setup-habitat
  do-plotting
  do-plotting-1

  reset-ticks
end 

to prey-traits
  if species = "Shark-fish"
  [ set color 84
    set shape "fish"
    set size 1.25]


  if species = "Falcon-duck"
    [ set color 36
    set shape "bird side"
    set size 1.25]



  if species = "Wolf-elk"
    [set color 22
    set shape "elk"
    set size 2.25]
end 

to predator-traits

    if species = "Shark-fish"
   [set color 2
    set size 4
    set shape "shark"]


  if species = "Falcon-duck"
    [ set color 33
    set shape "hawk"
    set size 2.5]

    if species = "Wolf-elk"
    [set color 0
    set shape "wolf"
    set size 1.25]
end 

to set-speed
  if species = "Shark-fish"
    [ set speed 1 + random-float 1]

   if species = "Falcon-duck"
  [ set speed 9 + random-float 1]


   if species = "Wolf-elk"
    [set speed 3 + random-float 1]
end 

to setup-prey
  create-prey Number-of-Prey
  [prey-traits
    set-speed
    setxy random-xcor random-ycor]
end 

to setup-predators
  create-predators Number-of-Predators
  [predator-traits
    set hit 0
    set-speed
    setxy random-xcor random-ycor]
end 

to setup-habitat
 ask patches
  [if species = "Shark-fish"
    [ set pcolor 105]

   if species = "Falcon-duck"
  [ set pcolor 88]


   if species = "Wolf-elk"
    [set pcolor green]
  ]
end 

;------------

to go
  if years = 0 [user-message "input the years"]
  if ticks >= years [stop]

  setup-habitat
  ask prey [prey-traits]
  ask predators [predator-traits]

  move
  predation
  predator-death

  if count prey = 0 [user-message "There is no prey." stop ]
  if count predators = 0 [user-message "There is no predator." stop ]

  reproduction
  energy-back
  do-plotting
  do-plotting-1

  tick
end 

to move
  ask turtles
  [rt random 45 lt random 45  fd 1]
end 

to predation
  ask predators [
    set hit 0
    ifelse spot-the-slowest-prey?
    [repeat 5 [
        let meal one-of prey with [speed = min [speed] of prey]
              if meal != nobody
                 [if [speed] of meal < [speed] of self
                    [ set hit hit + 1
                     ask meal [die] ]
  ]]]
    [repeat 5 [
        let meal one-of prey
              if meal != nobody
                 [if [speed] of meal < [speed] of self
                    [ set hit hit + 1
                     ask meal [die] ]
  ]]]
  ]
end 

to predation-1
  ask predators [
    set hit 0
    ifelse spot-the-slowest-prey?
    [repeat 5 [
        let possible-meal prey in-radius 10   ;Given the radius, the predator only hunts a subgroup of the population. This allows some slow prey survive at some point.
         if possible-meal != nobody [
        let meal one-of prey with [speed = min [speed] of possible-meal]
              if meal != nobody
                 [if [speed] of meal < [speed] of self
                    [ set hit hit + 1
                     ask meal [die] ]
  ]]]]
    [repeat 5 [
        let meal one-of prey in-radius 10
              if meal != nobody
                 [if [speed] of meal < [speed] of self
                    [ set hit hit + 1
                     ask meal [die] ]
  ]]]
  ]
end 

to predator-death
  ask predators with [hit < 3] [die]
end 

to reproduction
  set prey-mean-speed mean [speed] of prey
  set predator-mean-speed mean [speed] of predators

  create-prey Number-of-Prey - count prey
   [prey-traits
    ifelse random 2 = 0 [set speed prey-mean-speed + random-float Prey-speed-mutation][set speed prey-mean-speed - random-float Prey-speed-mutation]
    setxy random-xcor random-ycor]

  create-predators Number-of-Predators - count predators
   [predator-traits
    ifelse random 2 = 0 [set speed predator-mean-speed + random-float Predator-speed-mutation][set speed predator-mean-speed - random-float Predator-speed-mutation]
    setxy random-xcor random-ycor]
end 

to energy-back      ;This procedure is not in use.

  ask patches [if pcolor = 0
    [if species = "Shark-fish"
    [ set pcolor 105]

   if species = "Falcon-duck"
  [ set pcolor 88]


   if species = "Wolf-elk"
    [set pcolor green]
    ]
  ]
end 

to add-fast-prey
      create-prey 1
      [setxy random-xcor random-ycor
        prey-traits
        set speed max [speed] of prey + random-float 0.5]
end 

to add-slow-prey
  set slowest-prey-speed min [speed] of prey
  if slowest-prey-speed <= 0 [user-message "Have reached the slowest speed" stop]
      create-prey 1
      [setxy random-xcor random-ycor
        prey-traits
        set speed slowest-prey-speed - random-float 0.3
    ]
end 

to add-fast-predator
      create-predators 1
      [setxy random-xcor random-ycor
        predator-traits
        set speed max [speed] of predators + random-float 0.5]
end 

to add-slow-predator
  set slowest-predator-speed min [speed] of predators
  if slowest-predator-speed <= 0 [user-message "Have reached the slowest speed" stop]
      create-predators 1
      [setxy random-xcor random-ycor
        predator-traits
        set speed slowest-predator-speed - random-float 0.3]
end 

to do-plotting
set-current-plot "Prey Speed Distribution"
  set-plot-x-range (round min [speed] of turtles - 1) (round max [speed] of turtles + 1)
  histogram [speed] of prey
end 

to do-plotting-1
set-current-plot "Predator Speed Distribution"
  set-plot-x-range (round min [speed] of turtles - 1) (round max [speed] of turtles + 1)
  histogram [speed] of predators
end 

There are 2 versions of this model.

Uploaded by When Description Download
lin xiang almost 3 years ago update license Download this version
lin xiang over 5 years ago Initial upload Download this version

Attached files

File Type Description Last updated
coevolution.png preview Preview for 'coevolution' over 5 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.