# Decker-evolution

No preview image

Model was written in NetLogo 5.0RC4
•
Viewed 166 times
•
Downloaded 11 times
•
Run 2 times

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 [guerezas guereza] ;; black & white colobus monkey breed [badii badius] ;; red colobus monkey breed [mangabeys mangabey] ;; grey-cheeked mangabey monkey breed [rtmonkeys rtmonkey] ;; red-tail monkey turtles-own [energy] ;; all monkeys have energy patches-own [countdown] to setup clear-all ask n-of (forest) patches with [pcolor = black] [ set pcolor green ] ;; represents leaves ask n-of (forest / 2) patches with [pcolor = black] [ set pcolor yellow ] ;; represents fruit ask n-of (forest / 4) patches with [pcolor = black] [ set pcolor blue ] ;; represents insects create-guerezas 10 [ setxy random-xcor random-ycor set energy 75 set shape "monkey" set color gray set size 2 ] create-badii 10 [ setxy random-xcor random-ycor set energy 75 set shape "monkey" set color 26 set size 2 ] create-mangabeys 10 [ setxy random-xcor random-ycor set energy 75 set shape "monkey" set color white set size 2 ] create-rtmonkeys 10 [ setxy random-xcor random-ycor set energy 75 set shape "monkey" set color red set size 2 ] if REGROWTH? [ ask patches [ set countdown leaves-regrowth-time if countdown <= 0 and pcolor = 51 [set pcolor green]] ask patches [ set countdown insect-regeneration-time if countdown <= 0 and pcolor = 101 [ set pcolor blue]] ] reset-ticks end ;;;;;; to go tick if not any? turtles [ stop ] if regrowth? [ ask patches [ grow-leaves ] ask patches [ insects] ask patches [fruit-regeneration] ] if dispersal? [ ask turtles [poop] ask patches [regenerate] ask patches [fruiting] ] ask mangabeys [ move eat-mangabeys reproduce ] ask rtmonkeys [ move eat-rtmonkeys reproduce ] ask badii [ move-colobine eat-badii reproduce ] ask guerezas [ move-colobine eat-guerezas reproduce ] end to move ifelse pcolor = yellow [ set heading random 360 fd 3 set energy (energy - .25) if energy < 1 [die] if dispersal? [poop]][set heading random 360 fd 3 set energy (energy - .25) if energy < 1 [die]] end to move-colobine ifelse pcolor = yellow [ set heading random 360 fd 1 set energy (energy - .25) if energy < 1 [die] if dispersal? [poop]][set heading random 360 fd 1 set energy (energy - .25) if energy < 1 [die]] end to reproduce if random-float energy > 150 [ set energy (energy / 2) hatch 1 [rt random-float 360 fd 2] ] end ;;;;;; to eat-guerezas if pcolor = green [ set energy (energy + 2) set pcolor 51 ] if pcolor = lime [ set energy (energy + 2) set pcolor 51 ] if pcolor = yellow [ set energy (energy + .5) set pcolor 41 ] if pcolor = blue [ set energy (energy + .6) set pcolor 101 ] end to eat-badii if pcolor = green [ set energy (energy + 1.5) set pcolor 51 ] if pcolor = lime [ set energy (energy + 1.5) set pcolor 51 ] if pcolor = yellow [ set energy (energy + 1) set pcolor 41 ] if pcolor = blue [ set energy (energy + .6) set pcolor 101 ] end to eat-rtmonkeys if pcolor = green [ set energy (energy + .5) set pcolor 51 ] if pcolor = lime [ set energy (energy + .5) set pcolor 51 ] if pcolor = yellow [ set energy (energy + 2) set pcolor 41 ] if pcolor = blue [ set energy (energy + 1.5) set pcolor 101 ] end to eat-mangabeys if pcolor = green [ set energy (energy + .5) set pcolor 51 ] if pcolor = lime [ set energy (energy + .5) set pcolor 51 ] if pcolor = yellow [ set energy (energy + 2) set pcolor 41 ] if pcolor = blue [ set energy (energy + 1.5) set pcolor 101 ] end ;;; to grow-leaves if pcolor = 51 [ ifelse countdown <= 0 [ set pcolor green set countdown leaves-regrowth-time ] [ set countdown countdown - 1 ] ] end ;;; to insects if pcolor = 101 [ ifelse countdown <= 0 [set pcolor blue set countdown insect-regeneration-time] [ set countdown countdown - 1] ] end ;;; to fruit-regeneration if pcolor = 41 [ ifelse countdown <= 0 [set pcolor yellow set countdown fruiting-time] [set countdown countdown - 1 ]] end ;;; to poop if pcolor = yellow or pcolor = black or pcolor = 51 [ set pcolor brown ifelse countdown <= 0 [set countdown leaves-regrowth-time] [set countdown countdown - 1 ]] end to regenerate if pcolor = brown [ ifelse countdown <= 0 [set pcolor lime set countdown leaves-regrowth-time] [set countdown countdown - 1] ] end to fruiting if pcolor = lime [ ifelse countdown <= 0 [set pcolor yellow set countdown fruiting-time] [set countdown countdown - 1 ] ] end

There is only one version of this model, created almost 8 years ago by Pratim Sengupta.

## Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.