- Art
- Astronomy
- Biology
- Selection and Mutation Series
- Ant Patterns
- Bacterial Growth
- Bark Beetles
- Biological Buffer
- Birds Competing For Worms
- Color Bunnies
- Ecosystem - Predator, Prey, and Grass
- Ecosystem - Rabbits and Grass
- Ecosystem - Two Species
- Ecosystem With Predator, Prey, And Grass
- Forest Fire
- Honeycomb Formation
- Termites Perimeter
- Yeast Growth
- Chemistry
- Earth Science
- Mathematics
- Physics
- Social Science
Ecosystem - Rabbits and Grass
Submitted by librarian on Tue, 2006-08-08 12:56. :: Category
WHAT IS IT?
This project explores a simple ecosystem made up of rabbits and grass. The rabbits wander around randomly, and the grass grows randomly. When a rabbit bumps into some grass, it eats the grass and gains energy. If the rabbit gains enough energy, it reproduces. If it doesn't gain enough energy, it dies.
HOW TO USE IT
Click the SETUP button to set up the rabbits (red) and grass (green). Click the GO button to start the simulation.
The NUMBER slider controls the initial number of rabbits. The HATCH-THRESHOLD slider sets the energy level at which the rabbits reproduce. The GRASS-GROWTH-RATE slider controls the rate at which the grass grows. (Note: If you change the GRASS-GROWTH-RATE in the middle of a simulation, the change will not take effect until the next setup.)
THINGS TO NOTICE
Watch the TOTAL-RABBITS monitor to see how the rabbit population changes over time. At first, there is plenty of grass for the rabbits. The rabbits gain energy and reproduce. The abundance of rabbits leads to a shortage of grass, and soon the rabbit population begins to decline. This allows the grass to grow more freely, providing an abundance of food for the remaining rabbits, and the cycle begins again.
The rabbit population goes through a damped oscillation, eventually stabilizing in a narrow range. The total amount of grass also oscillates, out of phase with the rabbit population.
These dual oscillations are characteristic of predator-prey systems. Such systems are usually described by a set of differential equations known as the Lotka-Volterra equations. StarLogo provides a new way of studying predatory-prey systems and other ecosystems.
EXPLORATIONS
With the current settings, the rabbit population goes through a damped oscillation. By changing the parameters, can you create an undamped oscillation? Or an unstable oscillation?
In the current version, each rabbit has the same hatch-threshold. What would happen if each rabbit had a different hatch-threshold? What if the hatch-threshold of each new rabbit was slightly different from the hatch-threshold of its parent? How would the values for hatch-thresshold evolve over time?
STARLOGO FEATURES
This project uses turtles to "grow" the grass. It would be more "natural" for the patches to grow the grass, with a command like: if (random 1000) = 0 [setpc green] But that command would be much slower, since all of the patches would need to execute the command.
Turtle procedures
turtles-own [energy species [rabbit grass] ]
;turtles have an energy variable and can be of species rabbit or species grass (note:
;this could also be accomplished by using Starlogo's breed function.
;The turtle setup procedure. The turltes are moved to random positions, a certain number
;defined by the grass-rate slider are made into "grass" species, the rest are made rabbits
;and are given a random energy between 0-9.
to setup
setxy random screen-width random screen-height
ifelse who < grass-rate
[setc black ht setspecies grass]
[setcolor blue
setspecies rabbit
setenergy random 10]
repeat 20 [grow]
end
;All grass turtles wiggle forward, and turn the patch ahead of them into grass.
to grow
if species = grass [ ;only grass turtles should do this
rt random 10 lt random 10
fd 1
if pc-ahead = green [stamp green] ;grass only grows near other grass
]
end
;This combiniation procedure lays out the steps rabbits should follow each turn.
to move
if species = rabbit [ ;only rabbit turtles should do this
takestep
eat-grass
reproduce
death
]
end
;If a turtle is on a green grass patch, it eats the grass by setting the patch color
;back to brown and increasing its own energy
to eat-grass
if pc = green [stamp brown setenergy energy + 1]
if energy > 30 [setenergy 30]
end
;The rabbits wiggle randomly, move forward, and decrease their energy with each step.
to takestep
rt random 50
lt random 50
setenergy energy - .25
fd 1
end
;When a rabbit's energy level is above the value given by the "hatch-threshold" slider,
;they reproduce and half their energy.
to reproduce
if energy > (hatch-threshold)
[setenergy energy * .5
hatch [seth random 360 jump 1]
]
end
;When a rabbit's energy reaches zero, they die.
to death
if energy < 0 [die]
end
Observer procedures
globals [mincolorgene maxcolorgene rangecolorgene avgcolorgene sdcolorgene temp totalcolorgene]
;The setup procedure prepares the model by clearing the screen and graph,
;painting the patches brown, creating the number of turtles set by the "number" slider,
;creating random patches of grass, and asking the turtles to run their own setup procedure.
to setup
ca
clearplot
setbg brown
crt number + grass-rate
ask-patches [if (random 100) < 25 [setpc green]]
ask-turtles [setup]
setup-graph
end
;Initializes the graph.
to setup-graph
pp1 ppreset setppc green
pp2 ppreset setppc blue
pp3 ppreset setppc black
setplot-title "Rabbits and Grass"
setplot-yrange 0 300
setplot-xrange 0 50
end
;Creates plots for the number of grass patches (green line) and the number of
;rabbits (blue line)
to graph-it ;graph the amount of grass (scaled) and turtles
pp1 ppd plot (count-pc green) / 5
pp2 ppd plot count-turtles-with [species = rabbit]
end
to total-rabbits
output count-turtles-with [species = rabbit]
end
to go
;the movebutton, grassbutton, and graphbutton are pressed
startmovebutton
startgrassbutton
startgraphbutton
startextinction
end
to stop-it
;the movebutton, grassbutton, and graphbutton are stopped
stopmovebutton
stopgrassbutton
stopgraphbutton
stopextinction
end
5089 reads
