Prey Choice Model - Optimal Foraging Theory

Prey Choice Model - Optimal Foraging Theory preview image

1 collaborator

Default-person Peter Yaworsky (Author)

Tags

anthropology 

Tagged by Peter Yaworsky 11 days ago

archaeology 

Tagged by Peter Yaworsky 11 days ago

behavioral decision making 

Tagged by Peter Yaworsky 11 days ago

hunter gatherers 

Tagged by Peter Yaworsky 11 days ago

optimal foraging theory 

Tagged by Peter Yaworsky 11 days ago

prey choice model: 

Tagged by Peter Yaworsky 11 days ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 45 times • Downloaded 0 times • Run 0 times
Download the 'Prey Choice Model - Optimal Foraging Theory' modelDownload this modelEmbed this model

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


Comments and Questions

What is this Model?

Original Source: The model provided here is an ABM of the Prey Choice Model as derived by Charnov (1976) and outlined in Stephens & Krebs (1986). Outline: Each forager's goal is to maximize their overall running mean return rate as they search the world for prey species. Each prey species has a different a. profitability, b. handling cost (time), and c. density on the landscape. The decision variable of the forager is, once they encounter a prey item, do they a. handle and consume that prey item gaining its energy but also paying in time the costs of handling, or b. pass on the prey item and continue searching for an item that is more profitable. If the post encounter return rate (energy/handling time) is greater than the mean running return rate of the forager, the forager should take the prey species. If the post encounter return rate is lower, the forager should continue searching for more profitable prey items. Insight: The model illustrates how the decision to handle a prey item is dependent on the abundance/encounter rate of the highest ranked prey items and that the abundance of lower prey ranked items does not matter. The model illustrates how long term return rate maximization can result in either narrow diets when the highest ranked resource is readily abundant or broadens when the highest ranked prey items are less abundant. It shows that a foraging organism sensitive to changes in long term return rates can readily adapt their diet. Illustrates the influence of population density increases on diet (more foragers) and how greater competition and resource depletion can result in a broadening of the diet. Works Cited: Charnov, Eric L. “Optimal Foraging: Attack Strategy of a Mantid.” The American Naturalist 110, no. 971 (1976): 141–51. Stephens, David W., and John R. Krebs. Foraging Theory. New Jersey: Princeton University Press, 1986.

Posted 11 days ago

Click to Run Model

; Prey Choice Model from Optimal Foraging Theory
; see Charnov, Eric L. “Optimal Foraging: Attack Strategy of a Mantid.” The American Naturalist 110, no. 971 (1976): 141–51.
; see Stephens, David W., and John R. Krebs. Foraging Theory. New Jersey: Princeton University Press, 1986.
; by Peter M. Yaworsky, PhD, Aarhus University/Copenhagen University. Adapted from code original written by Michael Barton (ASU).
;V1 submitted 18/2/2025

breed [foragers forager]
breed [animals animal]

foragers-own [time rr energy diet-breadth]
animals-own [species food-value processing-costs rank]
patches-own [ptimer]
globals [rank-list prey-list diversity _recording-save-file-name]

to Setup
  ;; (for this model to work with NetLogo's new plotting features,
  ;; __clear-all-and-reset-ticks should be replaced with clear-all at
  ;; the beginning of your setup procedure and reset-ticks at the end
  ;; of the procedure.)
  __clear-all-and-reset-ticks
  Setup_Animals
  Setup_Foragers
  Setup_Patches
end 

to Go
  ask foragers [
    Move
    set time ticks + 1
    set rr (energy / time)
    Forage
    Calculate-Diversity
    ]

  ask animals [
    Move
    ;;Reproduce
    ]

  ask patches [Patch_Color]

  Do_Plots
  tick
  if not any? foragers [stop]
end 

to Setup_Foragers
  create-foragers init-foragers
    [
    set shape "person"
    set size 2.5
    set color yellow
    set energy 0
    set prey-list [] ; rolling list of prey species taken
    ]
  ask foragers [setxy random-xcor random-ycor] ; place the foragers randomly in the world
end 

to Setup_Animals
  ; Create 4 animal species with different processing costs, food values, birth rates, and initial population densities

  let total-density (density1 + density2 + density3 + density4)
  let number1 round (init-prey * density1 / total-density)
  let number2 round (init-prey * density2 / total-density)
  let number3 round (init-prey * density3 / total-density)
  let number4 round (init-prey * density4 / total-density)

  set rank-list (list (food-value1 - processing-cost1) (food-value2 - processing-cost2)
    (food-value3 - processing-cost3) (food-value4 - processing-cost4))

  set rank-list sort-by [ [?1 ?2] -> ?1 > ?2 ] rank-list

  create-animals number1 [
    set species 1
    set shape "cow"
    set size 2
    set color brown
    set food-value food-value1
    set processing-costs processing-cost1
    set rank position (food-value1 - processing-cost1) rank-list + 1
    ]

  create-animals number2 [
    set species 2
    set shape "rabbit"
    set size 1.5
    set color grey
    set food-value food-value2
    set processing-costs processing-cost2
    set rank position (food-value2 - processing-cost2) rank-list + 1
    ]

  create-animals number3 [
    set species 3
    set shape "fish"
    set size 1.5
    set color blue
    set food-value food-value3
    set processing-costs processing-cost3
    set rank position (food-value3 - processing-cost3) rank-list + 1
    ]

  create-animals number4 [
    set species 4
    set shape "turtle"
    set size 1.5
    set color lime
    set food-value food-value4
    set processing-costs processing-cost4
    set rank position (food-value4 - processing-cost4) rank-list + 1
    ]

  ask animals [setxy random-xcor random-ycor] ; place the animals randomly in the world
end 

to Setup_Patches
  ask patches [set ptimer 20]
end 

to Move
  rt random 45
  lt random 45
  fd 1
end 

to Forage
  let prey one-of animals-here                  ;; seek a random animal
  if prey != nobody  [                          ;; did we get one?  If so,
    if (rr <= [food-value / processing-costs] of prey)
         [ ask patch-here [set pcolor red]
          ask patch-here [set ptimer 01]
          set energy energy + [food-value] of prey  ;; get energy from eating animal
          set time time + [processing-costs] of prey
          set prey-list fput ([species] of prey) prey-list ; add prey-species to running list of prey taken
        ]
      ]
  while [length prey-list > 100] [set prey-list remove-item 100 prey-list] ; manage running list of prey taken
end 

to Patch_Color
  ifelse ptimer < 20
    [set ptimer ptimer + 1]
    [if pcolor != black [set pcolor black]]
end 

to Calculate-Diversity
  set diversity 0
  if member? 1 prey-list [set diversity diversity + 1]
  if member? 2 prey-list [set diversity diversity + 1]
  if member? 3 prey-list [set diversity diversity + 1]
  if member? 4 prey-list [set diversity diversity + 1]
end 

to Do_Plots
  set-current-plot "Prey Taken"
  set-current-plot-pen "species 1"
  plot length (filter [ ?1 -> ?1 = 1 ] prey-list)
  set-current-plot-pen "species 2"
  plot length (filter [ ?1 -> ?1 = 2 ] prey-list)
  set-current-plot-pen "species 3"
  plot length (filter [ ?1 -> ?1 = 3 ] prey-list)
  set-current-plot-pen "species 4"
  plot length (filter [ ?1 -> ?1 = 4 ] prey-list)
  set-current-plot "Forager Energy"
  set-current-plot-pen "fenergy"
  plot (mean [rr] of foragers)
end 

to Check-Death
  ask foragers [if energy <= 0 [die]]
end 

There is only one version of this model, created 11 days ago by Peter Yaworsky.

Attached files

File Type Description Last updated
Prey Choice Model - Optimal Foraging Theory.png preview Preview for 'Prey Choice Model - Optimal Foraging Theory' 11 days ago, by Peter Yaworsky Download

This model does not have any ancestors.

This model does not have any descendants.