Foraging estimates

Foraging estimates preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.3 • Viewed 287 times • Downloaded 27 times • Run 0 times
Download the 'Foraging estimates' 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?

Foraging V3.0

HOW IT WORKS

New in V3.0 Now consider that value computations have a price to pay. Let's explore the parameter space in conditions where survival is not impacted by search strategy (F,R)

Updated in V2.2 So, let's expand the range of food value from (previous, V2.1) 50 - 100% to 15 - 100%. This should be done in grass methods, grow-grass

Updated in V2.1 Added switch to select this-model, with options "forage" and "random"

In code, changed if encounter-v < (search-v + search-cost) to if encounter-v < (search-v - search-cost) to reflect the cost of leaving to forage (search elsewhere)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

Includes: decay-factor to determine if grass survives. How to go about this? I think grass decay (disappearance, if any) should happen after the forager has decided whether or not to visit said patch but before it can actually eat it (say, forager/grass roll the dice to determine whether or not "projected" food will be available for consumption. So, in go, forager should decide, then move, then grass fate is determined.

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

Note that, in Kolling et al. 2012: Reward magnitudes were all presented in the form of 12 pre-trained abstract stimuli worth between 20 and 130 points in 10-point increments. While search costs were 10, 20, or 40. So, let's see, median value of stimuli was 70-80. The range of stimuli values, normalized to the max value, was from 20/130 = 15% to 100%. So, let's expand the range of offered food from (current, V2.1) 50 - 100% to 15 - 100%.

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

Foraging model based on the fMRI experiment by Kolling et al., 2012 Kolling, Nils, Timothy E. J. Behrens, Rogier B. Mars, and Matthew F. S. Rushworth. 2012. “Neural Mechanisms of Foraging.” Science 336 (6077): 95–98.

Grass modeling, in an earlier version of this model, was based on Wilensky, 1997 Wilensky, U. (1997). NetLogo Wolf Sheep Predation model. http://ccl.northwestern.edu/netlogo/models/WolfSheepPredation. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL

Coded in NetLogo 6.0.3 Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Comments and Questions

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

Click to Run Model

; Foraging V3.0

; WORLD INCLUDES
;globals [max-lifepoints]
breed [foragers forager]
foragers-own [name lifepoints encounter-v search-v expected-search-cost potential-search-cost]
patches-own [countdown food]
globals [list-search-costs max-grass-food likelihood-pay-search-cost food-value-range-L cost-per-computation]


; SETUP WORLD

to setup
  clear-all
  set list-search-costs [1 2 4]
  set likelihood-pay-search-cost 70
  set max-grass-food (max-gain-from-food * max-lifepoints / 100)
  set food-value-range-L 15 ; food-value-range-H (high) is unnecesary, as it is 100% of max-grass-food
  set cost-per-computation (1 * computing-cost / 100 ) / 6

  ;Initialize patches
  ask patches [set pcolor brown]

  ask n-of num-grassy-patches patches [ set pcolor green ]  ; num-grassy-patches patches turn green

    ask patches [
    ifelse pcolor = green
        [ set countdown grass-regrowth-time
          ;set food random max-grass-food]
          set food ( ( max-grass-food * food-value-range-L / 100 ) + random ( max-grass-food * (100 - food-value-range-L) / 100 ) )]
          ;set food median (list max-grass-food/2   max-grass-food]
      [ set countdown (random grass-regrowth-time / 2 + random grass-regrowth-time) ] ; initialize grass regrowth clocks randomly for brown patches
  ]

  ; Initialize foragers
  create-foragers initial-number-foragers [
    ;pen-down
    set shape "person"
    set color white
    set size 1.5
    setxy random-xcor random-ycor
    set lifepoints (max-lifepoints / 2 + random max-lifepoints / 2)
    ;set lifepoints random (2 * forager-gain-from-food)
  ]

  reset-ticks
end 



; FUNCTIONS

to go
  if not any? foragers [ user-message "Humanity has gone extinct :(" stop ] ; A little bit of humour

  ; Foragers
  ask foragers [

    set lifepoints lifepoints - 1 ; living ain't free
    set potential-search-cost one-of list-search-costs; ; is not "computed" by forager,
                                                      ; this info is "hidden" to the forager,
                                                      ; who will become aware of it only if we call compute-sc

    ; compute value (encountered, search) & cost (search)
    if lifepoints < (max-lifepoints * saciety-thresh / 100) [

      ifelse this-model = "forage" [
        compute-ev
        compute-sv
        compute-sc

        if encounter-v < (search-v - expected-search-cost) [
          movelegs
        ]
      ]
      [
        movelegs ; moves and pays search-cost. In "forage" mode, if encounter-v < (search-v - expected-search-cost),
      ]

    ]
  ]

  ; Patches
  ask patches [ decay-grass ]

  ; Foragers
  ask foragers [
    eat-grass
    death
  ]

  ; Patches
  ask patches [ grow-grass ]

  tick
end 



; Forager procedures

to compute-ev
  set encounter-v (food * (1 - (grass-decay-prob / 100) ))
  set lifepoints (lifepoints - cost-per-computation)
end 

to compute-sv
  ; from command line, in observer mode, got what I wanted with:
  ; ask forager 0 [set search-v sum [food] of neighbors]
  set search-v (sum [food] of neighbors) / 8 ; 'cause there are 8 neighbors
  set lifepoints (lifepoints - cost-per-computation)
end 

to compute-sc
  ; From Kolling et al 2012, Science:
  ; Decisions to search entailed a risk of point loss (which constituted the search cost) with a
  ; likelihood of 70%. The number of points that might be lost was set to three different levels
  ; and the level on each trial was indicated to the subject by the color of the box surrounding
  ; the search alternatives (potential point loss: red = 20; white = 10; green = 5).
  set expected-search-cost potential-search-cost
  set lifepoints (lifepoints - cost-per-computation)
end 

to should-isosig ; should I stay or ...
; phased out to include computation of foraging costs in f(movelegs)
end 

to movelegs
  set heading random 360
  fd 1
  if random-float 100 < likelihood-pay-search-cost [
    set lifepoints (lifepoints - potential-search-cost)
  ]
  ;set lifepoints (lifepoints - real-search-cost)
  ; it's not worth it to calculate a real-search-cost, just throw the dice
end 

to eat-grass  ; forager procedure
  ; sheep eat grass, turn the patch brown
  if pcolor = green [

    ;set lifepoints lifepoints + forager-gain-from-food  ; gain lifepoints by eating
    set lifepoints lifepoints + food  ; gain lifepoints by eating
    set pcolor brown
    set food 0
  ]
end 

to death ; forager procedure
  ; when energy dips below zero, die
  if lifepoints < 0 [ die ]
end 


; Patch procedures

to grow-grass  ; patch procedure
  ; countdown on brown patches: if reach 0, grow some grass
  if pcolor = brown [
    ifelse countdown <= 0
      [ set pcolor green
        set countdown grass-regrowth-time
        set food (max-grass-food / 2 + random max-grass-food / 2)
    ]
      [ set countdown countdown - 1 ]
  ]
end 

to decay-grass ; patch procedure
  if pcolor = green [
    if random-float 100 < grass-decay-prob [ ; will grass survive? throw dice...
      set pcolor brown
      set food 0 ]
  ]
end 

; REPORT VARIABLES

to-report grass
  let grass-q patches with [pcolor = green] ; patches with [pcolor = green]
  let grass-report ((count grass-q / 50) * (initial-number-foragers / 25))
  report grass-report
end 

There is only one version of this model, created over 7 years ago by Mike Cisneros-Franco.

Attached files

File Type Description Last updated
Foraging estimates.png preview Preview for 'Foraging estimates' over 7 years ago, by Mike Cisneros-Franco Download

This model does not have any ancestors.

This model does not have any descendants.