Bluebles2
No preview image
Model was written in NetLogo 5.0RC7
•
Viewed 270 times
•
Downloaded 25 times
•
Run 0 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
globals [trees] ;; keep track of how many trees there are ;; spiny bluebles, blue longneck bluebles, green longneck bluebles and green bluebles are all breeds of turtles breed [spinybluebles spinyblueble] breed [bluelongneckbluebles bluelongneckblueble] breed [greenlongneckbluebles greenlongneckblueble] breed [greenbluebles greenblueble] turtles-own [energy] patches-own [countdown] to setup clear-all ask patches [ set pcolor 62 ] ask patches [ set countdown random 10 ;; initialize tree grow clocks randomly set pcolor one-of [62 white] ;; dark green or white ] set-default-shape spinybluebles "spiny blueble" create-spinybluebles initial-number-spinybluebles ;; create the spiny bluebles, then initialize their variables [ set color 105 ;; blue set size 7 ;; easier to see set energy random 50 setxy random-xcor random-ycor ] set-default-shape bluelongneckbluebles "longneck blueble" create-bluelongneckbluebles initial-number-bluelongneckbluebles ;; create the blue longneck bluebles, then initialize their variables [ set color 105 ;; blue set size 7 ;; easier to see set energy random 50 setxy random-xcor random-ycor ] set-default-shape greenlongneckbluebles "longneck blueble" create-greenlongneckbluebles initial-number-greenlongneckbluebles ;; create the green longneck bluebles, then initialize their variables [ set color 64 ;; green set size 7 ;; easier to see set energy random 50 setxy random-xcor random-ycor ] set-default-shape greenbluebles "spiny blueble" create-greenbluebles initial-number-greenbluebles ;; create the green bluebles, then initialize their variables [ set color 64 ;; green set size 7 ;; easier to see set energy random 50 setxy random-xcor random-ycor ] RESET-TICKS end to go if not any? turtles [ stop ] ask spinybluebles [ move set energy energy - 1 ;; deduct energy for spinybluebles death reproduce-spinybluebles ] ask bluelongneckbluebles [ move set energy energy - 1 ;; deduct energy for bluelongneckbluebles eat-trees death reproduce-bluelongneckbluebles ] ask greenlongneckbluebles [ move set energy energy - 1 ;; deduct energy for greenlongneckbluebles eat-trees death reproduce-greenlongneckbluebles ] ask greenbluebles [ move set energy energy - 1 ;; deduct energy for greenbluebles death reproduce-greenbluebles ] ask patches [ grow-trees ] set trees count patches with [pcolor = 62] ;; dark green tick end to move ;; turtle procedure rt random 50 lt random 50 fd 1 end to eat-trees ;; longneck bluebles procedure ;; longneck bluebles eat grass, turn the patch white if pcolor = 62 [ ;; dark green set pcolor white set energy energy + 2 ;; longneck bluebles gain energy by eating ] end to reproduce-spinybluebles ;; spinybluebles procedure if random-float 100 < bluebles-reproduce [ ;; throw "dice" to see if you will reproduce set energy (energy / 2) ;; divide energy between parent and offspring hatch 1 [ rt random-float 360 fd 1 ] ;; hatch an offspring and move it forward 1 step ] end to reproduce-bluelongneckbluebles ;; bluelongneckbluebles procedure if random-float 100 < bluebles-reproduce [ ;; throw "dice" to see if you will reproduce set energy (energy / 2) ;; divide energy between parent and offspring hatch 1 [ rt random-float 360 fd 1 ] ;; hatch an offspring and move it forward 1 step ] end to reproduce-greenlongneckbluebles ;; bluelongneckbluebles procedure if random-float 100 < bluebles-reproduce [ ;; throw "dice" to see if you will reproduce set energy (energy / 2) ;; divide energy between parent and offspring hatch 1 [ rt random-float 360 fd 1 ] ;; hatch an offspring and move it forward 1 step ] end to reproduce-greenbluebles ;; greenbluebles procedure if random-float 100 < bluebles-reproduce [ ;; throw "dice" to see if you will reproduce set energy (energy / 2) ;; divide energy between parent and offspring hatch 1 [ rt random-float 360 fd 1 ] ;; hatch an offspring and move it forward 1 step ] end to death ;; turtle procedure ;; when energy dips below zero, die if energy < 0 [ die ] end to grow-trees ;; patch procedure ;; countdown on white patches: if reach 0, grow some grass if pcolor = white [ ifelse countdown <= 0 [ set pcolor 62 set countdown 10 ] [ set countdown countdown - 1 ] ] end
There is only one version of this model, created over 12 years ago by Kay Ramey.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.