Questions…
• How does the “energy-from-grass” parameter influence the emergent patterns observed in the model simulation?
When the energy a turtle receives from a grass patch is high, it results in a large population of turtles since the requirements for hatching are easily met. The opposite is true when energy from grass is at a lower setting.
• How does the “birth-energy” parameter influence the emergent patterns observed in the model simulation?
Low initial birth energy results in rapid, unstable breeding since the parameter to hatch is “if energy>birth-energy”, when given a higher birth energy results in a lower more stable birth rate since the turtles need to gain more energy before hatching another turtle.
• Is the emergent pattern sensitive to the initial population size?
Initially, yes – however after a few seconds the pattern is governed by “birth-energy” and “energy-from-grass”
Video…
Code…
turtles-own [energy]
to setup
clear-all
setup-patches
setup-turtles
reset-ticks
end
to setup-patches
ask patches [ set pcolor green ]
end
to setup-turtles
create-turtles number
ask turtles [setxy random-xcor random-ycor]
end
to go
if ticks >= 500 [stop]
move-turtles
eat-grass
reproduce
check-death
regrow-grass
tick
end
to reproduce
ask turtles
[if energy > birth-energy
[set energy energy – birth-energy
hatch 1 [set energy birth-energy]]]
end
to check-death
ask turtles
[if energy <= 0 [die]]
end
to regrow-grass
ask patches
[if random 100 < 3 [set pcolor green]]
end
to eat-grass
ask turtles
[if pcolor = green
[set pcolor black
set energy (energy + energy-from-grass)]
ifelse show-energy?
[set label energy]
[set label “”]]
end
to move-turtles
ask turtles
[right random 360
forward 1
set energy energy – 1]
end
to make-movie
user-message “First, save your new movie file (choose a name ending with .mpg)”
let path user-new-file
if not is-string? path [ stop ]
setup
movie-start path
movie-grab-view
while [ ticks < 500 ]
[go
movie-grab-view]
movie-close
user-message (word “Exported movie to ” path)
end