Population survival inside a dynamic forest

Population survival inside a dynamic forest preview image

1 collaborator

Default-person Leonardo Saravia (Author)

Tags

extinctions 

Tagged by Leonardo Saravia about 1 month ago

forest dynamics 

Tagged by Leonardo Saravia about 1 month ago

population dynamics 

Tagged by Leonardo Saravia about 1 month ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.0 • Viewed 36 times • Downloaded 0 times • Run 0 times
Download the 'Population survival inside a dynamic forest' 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

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

Click to Run Model

breed [forest one-forest] ; forest patches
breed [birds bird]        ; living birds

globals [ total-patches   ; Measure the total number of patches
          cumul-birds-list   ; List to calculate the average of bird proportion
          gr-forest
          gr-birds
        ]

extensions [profiler]

to setup-ini
  clear-all
  set total-patches count patches
  set-default-shape birds "circle"
  set-default-shape forest "circle"
  set cumul-birds-list []
end 

to setup
  setup-ini

  ask n-of initial-population patches [
    sprout-forest 1 [set color green set size 1]
    sprout-birds 1 [ set color white set size .7]
  ]
  reset-ticks
end 

to setup-full
  setup-ini
  ask patches[
      sprout-forest 1 [set color green set size 1]
      sprout-birds 1 [ set color white set size .7]
  ]
  reset-ticks
end 

to setup-center
  setup-ini
  ask patches with [(abs pycor < 6) and (abs pxcor < 6)]
  [
    sprout-forest 1 [set color green set size 1]
    sprout-birds 1 [ set color white set size .7]
  ]
  reset-ticks
end 

to go
  ;; updates the probabilities of growth
  set gr-forest birth-rate-forest /( death-rate-forest + birth-rate-forest )
  set gr-birds birth-rate-birds /( death-rate-birds + birth-rate-birds )

  ask forest [ grow-forest ]
  (ifelse
    birds-behavior = "NoSelection" [
      ask birds [ grow-birds-no-selection ]
    ]
    birds-behavior = "BirthSelection" [
      ask birds [ grow-birds ]
    ]
    birds-behavior = "AdultSelection" [
      ask birds [ grow-birds-adult-selection ]
    ]

  )
  ;calc-birds-mean

  tick
  if habitat-proportion = 0 [stop]
  if (check-birds-extinction = true) and (birds-proportion = 0) [stop]
end 

to grow-forest
  ifelse random-float 1 > gr-forest
  [
    ;show "1 forest died"
    die
  ]
  [
    ask one-of neighbors4 [
      if not any? forest-here [
         sprout-forest 1 [set color green set size 1]

      ]
    ]
  ]
end 

;;
;; birds procedure: if newborns select a suitable patch if exist
;;

to grow-birds
  ifelse random-float 1 > gr-birds
    [ die ]
    [
      if any? forest-here [

          let target one-of neighbors4 with [any? forest-here  and not any? birds-here]
          if target != nobody [
            hatch-birds 1 [ move-to target ]
          ]
      ]
    ]
end 

;;
;; Birds procedure: birds select at random a patch to newborns
;;

to grow-birds-no-selection
  ifelse random-float 1 > gr-birds
    [ die ]
    [
      if any? forest-here [

        let target one-of neighbors4
        if (any? forest-on target and not any? birds-on target) [
          hatch-birds 1 [ move-to target ]
        ]

      ]
    ]
end 

;;
;; Birds select a suitable patch for newborns and if the forest dies they select a new forest patch
;;

to grow-birds-adult-selection
  ifelse random-float 1 > gr-birds
    [ die ]
    [
      ifelse any? forest-here [

        let target one-of neighbors4 with [any? forest-here  and not any? birds-here]
        if target != nobody [
          hatch-birds 1 [ move-to target ]
        ]
      ]
      [
        ;;show (word "Se va a mover" pxcor pycor)
        let target one-of neighbors4 with [any? forest-here and not any? birds-here]
          if target != nobody [
            move-to target
            ;; show (word "se movio!!!!!!!!"  pxcor pycor)
          ]
      ]
    ]
end 

to-report habitat-proportion
  report count forest / total-patches
end 

to-report birds-proportion
  ;print "Calculate birds proportion"
  report count birds / total-patches
end 

to calc-birds-mean
  ;if empty? cumul-birds-list
  ;; drop the first member of the list, but not until there are at least 100 items in the list
  if (length cumul-birds-list > 200) [ set cumul-birds-list but-first cumul-birds-list ]

  ;; add the number of birds-proportion in last tick to the end of the list
  set cumul-birds-list lput birds-proportion cumul-birds-list
end 

to-report check-birds-steady-state
  if ticks > 500 [

    let up-birds mean cumul-birds-list + (  standard-deviation cumul-birds-list )
    let down-birds mean cumul-birds-list - ( standard-deviation cumul-birds-list )

    if birds-proportion > down-birds and birds-proportion < up-birds
    [ report true ]
  ]
  report false
end 

There is only one version of this model, created about 1 month ago by Leonardo Saravia.

Attached files

File Type Description Last updated
Population survival inside a dynamic forest.png preview Preview for 'Population survival inside a dynamic forest' about 1 month ago, by Leonardo Saravia Download

This model does not have any ancestors.

This model does not have any descendants.