Predation

Predation preview image

1 collaborator

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

Tags

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 135 times • Downloaded 14 times • Run 0 times
Download the 'Predation' 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 predation interaction and the patterns of population changes over time.

HOW IT WORKS

Agents:

There are three types of agents: plants, rabbits, and foxes.

Model Rules:

  1. There are 168 patches (light blue squares) in the model. The nutrients in each patch may support and only support one plant.

  2. Rabbits feed on plants; foxes prey on rabbits; and plants regrow every year.

  3. Foxes and rabbits lose energy when they move around to search for food and die when running out of energy.

  4. Foxes and rabbits gain energy when they find food and will produce offspring when they accumulate enough energy.

HOW TO USE IT

  1. Use sliders number-of-plants and other similar sliders to set up the number of organisms. Click Start/Reset to confirm the settings.

  2. Put a number in years to define when the model ends.

  3. Click Run/Pause to run or pause the model. Good for gaining an overview and a long-term result.

  4. Click Run a year to run the model for a hypothetical year. Good for systematically collecting data.

  5. Use plot-plants? and other similar switches to decide whether or not to plot certain organisms in the real-time plot. Good for providing a clear visualization.

  6. Use plant-growth-rate to adjust annual plant growth; use remove rabbits" or **remove foxes to remove the animals. Good for exploring the interaction between two organisms.

THINGS TO TRY

  • What population patterns emerge when only plants and rabbits are present in the model?

  • What population patterns emerge when only plants and foxes mouse species are present in the model?

  • What population patterns emerge when only rabbits and foxes mouse species are present in the model?

  • What population patterns emerge when all three species are present in the model?

  • How does plant growth rate affect the interactions among the three species?

RELATED MODELS

Find more community interaction models at http://3dsciencemodeling.com

CREDITS AND REFERENCES

Dr. Lin Xiang (lin.xiang@uky.edu) created this module at the University of Kentucky in 2022. If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2022). Predation. Department of STEM Education, University of Kentucky, Lexington, KY.

Comments and Questions

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

Click to Run Model

; Coded in 2022 by Lin Xiang; Last revised in 2022 by Lin Xiang (lxiang75@gmail.com; lin.xiang@uky.edu)
;;
;; If you mention this model in a publication, we ask that you include the citations below.
;;
;; Xiang, L. (2022). Predation. Department of STEM Education, University of Kentucky, Lexington, KY.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



breed [plant1s plant1]
breed [plant2s plant2]
breed [animal1s animal1 ]
breed [animal2s animal2 ]
breed [legends legend]

plant1s-own [ num-seed-1 erg-0]
plant2s-own [ num-seed-2 erg-00]
animal1s-own [erg-1 life-1]
animal2s-own [erg-2 life-2]

patches-own []

Globals [
  running-avg-list1  running-avg-list2
  running-avg-lista1  running-avg-lista2

  mean-total-1 mean-total-2
  mean-total-a1 mean-total-a2
]

to-report empty-patches
  report patches with [pcolor <= 79.5 and pcolor >= 79 and not any? plant2s-here]
end 

to setup
  clear-all

  setup-patches
  setup-legends
  add-plants2
  add-rabbits
  add-foxes

  set running-avg-list1 []
  set running-avg-list2 []
  set running-avg-lista1 []
  set running-avg-lista2 []

  reset-ticks
end 

to setup-patches
  ask patches [set pcolor 79 + random-float 0.5]
  ask patches with [ pycor < 2 or pycor = max-pycor ] [set pcolor white]
end 

to add-plants2
ask up-to-n-of number-of-plants empty-patches
    [sprout-plant2s 1
    [set shape "weed-1"
    set size 0.6 + random-float 0.4
    set erg-00 10]]
end 

to add-rabbits
  create-animal1s number-of-rabbits
 [set shape "rabbit-1" set color 36 set size 0.75 set erg-1 5 + random 5 setxy 1 + random 10  2 + random 14
 ]
end 

to add-foxes
 create-animal2s number-of-foxes
 [set shape "fox" set color 25 set size 1.25 set erg-2 10 + random 10 setxy 1 + random 10 2 + random 14
 ]
end 
;;;;;;;;;;;;;;;;;;;;;
;;   GO PROCEDURE  ;;
;;;;;;;;;;;;;;;;;;;;;

to go
 every 0.1[
  if ticks >= Years [stop]
  move
  reproduce-2
  death
  feeding-1
  feeding-2

  find-running-avg
    tick
]
end 

to move
  if any? animal1s [ask animal1s
                     [ifelse life-1 >= 10 [die] [set life-1 life-1 + 1]
                      right random 360
                      if [pcolor] of patch-at dx dy <= 79.5 and [pcolor] of patch-at dx dy >= 79  [fd 1 if ycor < 2 [set ycor 2] set erg-1 erg-1 - 1]
                      if erg-1 <= 0 [die]]]

  if any? animal2s [ask animal2s
                      [ifelse life-2 >= 30 [die] [set life-2 life-2 + 1]
                       right random 360
                       if [pcolor] of patch-at dx dy <= 79.5 and [pcolor] of patch-at dx dy >= 79  [fd 1 if ycor < 2 [set ycor 2] set erg-2 erg-2 - 1]
                       if erg-2 <= 0 [die]]]
end 

to feeding-1
 ask animal1s [
    if any? plant2s-here [
      let food one-of plant2s-here
      set erg-1 erg-1 + [erg-00] of food
      ask food [die]]]

  ask animal1s [if random 100 < 80
    [if erg-1 > 20
      [hatch 1 [set erg-1 10 set life-1 0]
        set erg-1 erg-1 - 10]]]
end 

to feeding-2
 ask animal2s [
    if any? animal1s-here [
      let food one-of animal1s-here
      set erg-2 erg-2 + [erg-1] of food
      ask food [die]]]

   ask animal2s [if random 100 < 35
    [if erg-2 > 40
      [hatch 1 [set erg-2 20 set life-2 0]
      set erg-2 erg-2 - 20]]]
end 

to reproduce-2
  if any? plant2s
    [ask plant2s
       [ask neighbors with [pcolor <= 79.5 and pcolor >= 79 and not any? plant2s-here]
        [if random 100 < plant-growth-rate
           [sprout-plant2s 1
            [set shape "weed-1"
             set size 0.6 + random-float 0.4
             set erg-00 10]]
  ]]]
end 

to death

  ask plant2s
  [if random 100 < 5 [die]]  ;a small mortality to allow regrow
end 

to find-running-avg  ;find the 5-year running averages
   (ifelse
    ticks < 10
     [set running-avg-list1 lput (count plant1s) running-avg-list1 set mean-total-1 mean running-avg-list1
      set running-avg-list2 lput (count plant2s) running-avg-list2 set mean-total-2 mean running-avg-list2

      set running-avg-lista1 lput (count animal1s) running-avg-lista1 set mean-total-a1 mean running-avg-lista1
      set running-avg-lista2 lput (count animal2s) running-avg-lista2 set mean-total-a2 mean running-avg-lista2]

     [set running-avg-list1 lput count plant1s running-avg-list1 set running-avg-list1 remove-item 0 running-avg-list1 set mean-total-1 mean running-avg-list1
      set running-avg-list2 lput count plant2s running-avg-list2 set running-avg-list2 remove-item 0 running-avg-list2 set mean-total-2 mean running-avg-list2

      set running-avg-lista1 lput count animal1s running-avg-lista1 set running-avg-lista1 remove-item 0 running-avg-lista1 set mean-total-a1 mean running-avg-lista1
      set running-avg-lista2 lput count animal2s running-avg-lista2 set running-avg-lista2 remove-item 0 running-avg-lista2 set mean-total-a2 mean running-avg-lista2])
end 

to setup-legends

  create-legends 9

  ask legend 0
  [set shape "weed-1"
    set size 1
    set color 55
    setxy 1.5 0.75]

  ask legend 1
  [set shape "rabbit-1"
    set color 36
    set size 1.25
    setxy 4.5 0.75]


  ask legend 2
  [set shape "fox"
    set color 25
    set size 2
    setxy 8 0.75]

  ask legend 3
  [set shape "line"
    set color 8
    set size 13
    set heading 90
    setxy 5.5 1.5]

  ask legend 4
  [set shape "arrow-1"
    set color 136
    set size 1.5
    set heading 90
    setxy 3 0.75]

  ask legend 5
  [set shape "arrow-1"
    set color 136
    set size 1.5
    set heading 90
    setxy 6 0.75]

  ask legend 6
  [set shape "blank"
    set color 136
    set size 1.5
    set label "rabbit"
    set label-color 0
    set heading 75
    setxy 4.3 0.5]

  ask legend 7
  [set shape "blank"
    set color 136
    set size 1.5
    set label "plant"
    set label-color 0
    set heading 75
    setxy 1.1 0.5]

  ask legend 8
  [set shape "blank"
    set color 136
    set size 1
    set label "fox"
    set label-color 0
    set heading 75
    setxy 8 0.25]
end 

There are 2 versions of this model.

Uploaded by When Description Download
lin xiang about 2 years ago Update the plotting Download this version
lin xiang over 2 years ago Initial upload Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.