Jebel Sahaba Model 1 - equal resource distribution
Model was written in NetLogo 6.1.1
•
Viewed 102 times
•
Downloaded 14 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Info tab cannot be displayed because of an encoding error
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
globals [ max-people max-arrows ] breed [ people person ] breed [ arrows arrow ] turtles-own [ energy ] patches-own [ countdown ] to setup clear-all ask patches [ set pcolor green ] create-people initial-number-people [ set shape "person" set color black set size 1.5 set energy random (2 * people-gain-from-food) setxy random-xcor random-ycor ] create-arrows initial-number-arrows [ set shape "arrow" set color red set size 1.5 set energy random (2 * arrows-gain-from-food) setxy random-xcor random-ycor ] reset-ticks end to go if not any? turtles [ stop ] if not any? arrows and count people > max-people [ user-message "Agriculturalists won" stop ] if not any? people and count arrows > max-people [ user-message "Hunter gatherers won" stop ] ask people [ move set energy energy - 1 eat-grass eat-arrows death reproduce-people ] ask arrows [ move set energy energy - 1 eat-grass eat-people death reproduce-arrows ] ask patches [ grow-grass ] tick end to move rt random 50 left random 50 fd 1 end to eat-grass if pcolor = green [ set pcolor brown set energy energy + people-gain-from-food set energy energy + arrows-gain-from-food ] ifelse show-energy? [ set label energy ] [set label "" ] end to reproduce-people ; if random-float 100 < people-reproduce [ set energy (energy / 2) hatch 1 [ rt random-float 360 fd 1 ] ] end to reproduce-arrows if random-float 100 < arrows-reproduce [ set energy (energy / 2) hatch 1 [ rt random-float 360 fd 1 ] ] end to eat-people let prey one-of people-here if prey != nobody [ ask prey [ die ] set energy energy + arrows-gain-from-food ] end to eat-arrows let prey one-of arrows-here if prey != nobody [ ask prey [ die ] set energy energy + people-gain-from-food ] end to death if energy < 0 [ die ] end to grow-grass if pcolor = brown [ ifelse countdown <= 0 [ set pcolor green set countdown grass-regrowth-time ] [ set countdown countdown - 1 ] ] end
There are 2 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Jebel Sahaba Model 1 - equal resource distribution.png | preview | Preview for 'Jebel Sahaba Model 1 - equal resource distribution' | over 3 years ago, by Durr-e-Maknoon Tariq | Download |
This model does not have any ancestors.
This model does not have any descendants.