Hunter-Gatherer Modal FINAL

No preview image

1 collaborator

Default-person Audrey Hosford (Author)

Tags

(This model has yet to be categorized with any tags)
Part of project 'Hunter-Gatherer Final Project'
Model group MAM-2013 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.4 • Viewed 612 times • Downloaded 50 times • Run 0 times
Download the 'Hunter-Gatherer Modal FINAL' 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 [hunters hunter] ;; create necessary breeds
breed [gatherers gatherer]
breed [rabbits rabbit]
breed [hunters-2 hunter-2]
breed [gatherers-2 gatherer-2]

globals [regrow] ;; likelihood of plants regrowing

hunters-own [ energy
             patience
             has-rabbit? ] 

gatherers-own [ has-food?
                energy ]

hunters-2-own [ energy
              patience
              has-rabbit? ]

gatherers-2-own [ has-food?
                energy ]

rabbits-own [ energy ]

to setup
  clear-all
  set-default-shape hunters "person" ;; create hunters
  set-default-shape gatherers "person" ;; create gatherers
  set-default-shape rabbits "rabbit" ;; create rabbits
  set regrow 100 ;; set plant regrowth likelihood
  ask patches
  [ ifelse random-float 100 < density 
    [ set pcolor yellow ] ;; scatter food based on selected density via slider
    [ set pcolor green ] ]
  create-hunters hunter-pop [ ;; create hunters based on selected pop. via slider
    set color red
    set size 5
    set energy 50 ;; they start hungry
    setxy random-xcor random-ycor
    set patience 100
    set has-rabbit? false
  ]
  create-gatherers gather-pop [
    set color white
    set size 5
    set energy 50 ;; start hungry
    setxy random-xcor random-ycor
    set has-food? false
  ]
  create-rabbits rabbit-pop [
    set color brown
    set size 3
    set energy 50
    setxy random-xcor random-ycor
  ]
  if two-tribes? [ ;; if two-tribe switch is ON, go ahead and create second tribe
    set-default-shape hunters-2 "person" ;; create hunters
    set-default-shape gatherers-2 "person" ;; create gatherers
    create-hunters-2 hunter-pop-two [
    set color blue
    set size 5
    set energy 50
    setxy random-xcor random-ycor
    set patience 100
    set has-rabbit? false
    ]
  create-gatherers-2 gather-pop-two [
    set color orange
    set size 5
    set energy 50
    setxy random-xcor random-ycor
    set has-food? false
    ]
  ]
  reset-ticks
end 

to go
  ask turtles [
    if not any? turtles [ stop ] ;; check to see if there are any live turtles
    move    ;; make all turtles move
    ask gatherers with [ not has-food? ] [ find-food ] ;; tell gatherers to find food
    ask gatherers with [ has-food? ] [ find-pile ] ;; once food is found, go put it in a pile
    ask gatherers with [ not has-food? ] [
      if energy < 70 [ eat-food ] ] ;; if they are hungry and don't have food in their hands, go eat
    ask hunters with [ not has-rabbit? ] [ hunt-rabbits ] ;; tell hunters to go hunt
    ask hunters with [ has-rabbit? and energy < 70 ] [ eat-rabbit ] ;; tell hungry hunters with rabbit in hand to eat
    if count rabbits = 0 [ ;; if there are no rabbits
      ask hunters with [ energy < 70 ] [ eat-food ;; eat from the food stores and lose patience
                                       set patience patience - 5  ]
      ask hunters with [ patience = 0 and energy < 30 ] [ kill-hunter2 ;; if patience has run out, attack other tribe and add to patience
                                                        set patience 50 ] ]
    if two-tribes? [ ;; if there are two tribes, let second tribe members perform same functions as above
      ask gatherers-2 with [ not has-food? ] [ find-food ]
      ask gatherers-2 with [ has-food? ] [ find-pile ]
      ask gatherers-2 with [ not has-food? ] [
        if energy < 70 [ eat-food ] ]
      ask hunters-2 with [ not has-rabbit? ] [ hunt-rabbits ]
      ask hunters-2 with [ has-rabbit? and energy < 70 ] [ eat-rabbit ]
      if count rabbits = 0 [
      ask hunters-2 with [ energy < 70 ] [ eat-food
                                       set patience patience - 5 ] ]
      ask hunters-2 with [ patience = 0 and energy < 30 ] [ kill-hunter
                                         set patience 50 ]
    ]
    if ticks mod 100 = 0 [ set energy (energy - 10) ] ;; lose some energy every 100 ticks
    if count rabbits != 0 [
      ask one-of rabbits [ reproduce-rabbits ] ] ;; if rabbits are still alive, reproduce
    ask rabbits with [ energy < 40 ] [ rabbit-eat ] ;; if rabbits are hungry, go eat food
    ask turtles with [ energy <= 0 ] [ die ]  ;; turtles with 0 energy die
    ]
  harvest-time ;; food regrows
  if count gatherers != 0 [ ;; if gatherers are healthy enough, there is a 10% chance one of them will reproduce
  if mean [energy] of gatherers > 60 and random 100 < 10 [ ask one-of gatherers [reproduce-human] ] ]
  if count gatherers-2 != 0 [
  if mean [energy] of gatherers-2 > 60 and random 100 < 10 [ ask one-of gatherers-2 [reproduce-human-2] ] ]
  if not any? turtles [ stop ] ;; stop conditions for model
  if not any? hunters and not any? hunters-2 and not any? gatherers and not any? gatherers-2 [ stop ] ;; we want model to stop when people are dead
  tick
end 


;; turtle procedure

to move 
  fd 1
  rt 20 - random 40
end 


;; turtle procedure to find food

to find-food   
    ;; we pick up food only if there is not already a lot of food around it
    ;; (i.e. on at least three patches)
    if pcolor = yellow and count neighbors with [ pcolor = yellow ] < 3 [
      ;; pick up food
      set has-food? true
      ;; remove food from patch
      set pcolor green      
    ]
end 


;; hunter/gatherer procedure to eat food

to eat-food
  if pcolor = yellow [
    ;; remove food from patch
    set pcolor green
    ;; replenish energy
    set energy ( energy + 5 ) ]
end 
  
;; gatherer procedure to find pile of food

to find-pile
  ;; if patch is part of a pile
  if pcolor = yellow and [ pcolor ] of patch-ahead 1 != yellow [
    ;; set food on patch ahead of me
    ask patch-ahead 1 [ set pcolor yellow ]
    ;; I no longer have food in my hands
    set has-food? false
  ]
end 

;; patch procedure to regrow food

to harvest-time
  ;; if random toss is in favor of regrowth
  if random 100 < regrow [
    ;; set a random, isolated green patch yellow (we don't want food sprouting near harvested piles)
  ask one-of patches with [ pcolor != yellow and 
    count neighbors with [ pcolor = yellow ] < 3 ] [ set pcolor yellow ] 
    ;; regrowth will be a bit slower now
    set regrow regrow - 1 ]
end 

;; hunter procedure to get rabbits

to hunt-rabbits
    let prey one-of rabbits-here                    ;; grab a random rabbit
  if prey != nobody                             ;; did we get one?  if so,
    [ ask prey [ die ] 
      set has-rabbit? true] ;; get energy from eating
end 

;; hunter procedure to eat rabbit

to eat-rabbit
  ;; I don't have a rabbit anymore
  set has-rabbit? false
  ;; replenish energy
  set energy energy + 10
end 

;; rabbit procedure to reproduce

to reproduce-rabbits
  if random 10000 < 3 [  ;; throw "dice" to see if you will reproduce
    hatch 1 [ rt random 360 fd 1 ]   ;; hatch an offspring and move it forward 1 step
  ]
end 

;; rabbit procedure to eat food

to rabbit-eat
  ;; rabbit doesn't care whether food is in pile or not, it just eats it!
  if pcolor = yellow [ set pcolor green ]
  ;; replenish energy
  set energy energy + 7
end 

;; hunter procedure to attack member of other tribe

to kill-hunter
  ;; 50-50 chance of killing either a hunter or a gatherer
  ifelse random 100 > 50
  [ let prey one-of hunters-2-here
    if prey != nobody
    [ ask prey [ die ] ] ]
  [ let prey one-of gatherers-2-here
    if prey != nobody
    [ ask prey [ die ] ] ]
end 

;; hunter procedure to attack member of other tribe, see above

to kill-hunter2
  ifelse random 100 > 50
  [ let prey one-of hunters-here
    if prey != nobody
    [ ask prey [ die ] ] ]
  [ let prey one-of gatherers-here
    if prey != nobody
    [ ask prey [ die ] ] ]
end 

;; gatherer procedure to reproduce

to reproduce-human
  ;; 50-50 chance of making either another gatherer or a new hunter
  ifelse random 100 > 50
  [ hatch-gatherers 1 [
      ;; give each child original stats from setup above
      rt random 360 fd 1
      set color white
      set size 5
      set energy 50
      set has-food? false ] ]
   [hatch-hunters 1 [
      rt random 360 fd 1
      set color red
      set size 5
      set energy 50
      set patience 100
      set has-rabbit? false
  ] ]
end 

;; gatherer procedure to reproduce, identical to above

to reproduce-human-2
  ifelse random 100 > 50
  [ hatch-gatherers-2 1 [
      rt random 360 fd 1
      set color orange
      set size 5
      set energy 50
      set has-food? false ] ]
  [ hatch-hunters-2 1 [
      rt random 360 fd 1
      set color blue
      set size 5
      set energy 50
      set patience 100
      set has-rabbit? false
  ] ]
end 

There is only one version of this model, created over 11 years ago by Audrey Hosford.

Attached files

File Type Description Last updated
AudreyHosford_FinalPaper.docx word Final Paper accompanying Hunter-Gatherer Model FINAL over 11 years ago, by Audrey Hosford Download
AudreyHosford_Poster.pptx powerpoint Poster over 11 years ago, by Audrey Hosford Download
Gatherer Model v4 copy experiment-spreadsheet.xlsx background BehaviorSpace experiment raw data accompanying Hunter-Gatherer Model FINAL over 11 years ago, by Audrey Hosford Download
Screen Shot 2013-06-11 at 1.27.34 AM.png png Image over 11 years ago, by Audrey Hosford Download

This model does not have any ancestors.

This model does not have any descendants.