Predator-Prey Ecosystem
Rabbits, foxes and grass in a live food web — watch Lotka-Volterra cycles and evolution unfold.
- Rabbit
- Fox
Rabbits graze and breed, foxes hunt them, grass regrows. Drag to drop rabbits or foxes, paint grass or burn it; Rerun starts again from step 0 with what you dropped and painted. Turn on Evolution to see speed and vision change over generations.
How is Predator-Prey Ecosystem working for you?
About Predator-Prey Ecosystem
Predator-Prey Ecosystem is a live simulation of rabbits, foxes and grass. Grass slowly regrows across the field. Rabbits wander, graze, hide in tall grass and run from foxes they notice; foxes roam and chase the rabbits they spot. Every animal burns energy each step, gains it by eating, splits into two when it has stored enough, and dies when it runs out of energy or grows old.
From those individual rules the populations swing through the classic boom-and-crash cycle described by the Lotka-Volterra equations. With plenty of rabbits, foxes feast and multiply; the growing fox population eats the rabbits down; the foxes then starve and dwindle; with few predators left, rabbits recover — and the cycle starts again, with the fox peak lagging behind the rabbit peak. The live population chart under the canvas makes the rhythm easy to see.
Turn on Evolution and each newborn inherits its parent's speed and vision with small random mutations. Speed and long sight help animals catch food or escape, but they cost energy (running costs rise steeply with speed), so natural selection balances the trade-off and the trait histogram shows the populations shifting over generations. Drop rabbits or foxes, plant or burn grass, and change regrowth and hunting skill to run experiments.
How to use Predator-Prey Ecosystem
- Press Play. Watch rabbits (white) graze the green field and foxes (orange arrows) hunt them. Grass turns brown where it has been eaten and grows back over time.
- Read the population chart. The Population chart plots rabbits and foxes over time. Look for the fox peak arriving after each rabbit peak — the signature of predator-prey cycles.
- Change the ecology. Raise Grass regrowth to feed more rabbits, or change Hunting skill to make foxes more or less successful, and see how the cycles change.
- Try evolution. Switch on Evolution so offspring inherit speed and vision with mutations, then watch the trait chart and the average values shift. Mutation sets how big each change can be.
- Intervene. Use the tools to drop rabbits or foxes, plant grass or burn it, then watch the ecosystem respond. Reintroduce if extinct adds a few animals back if a species dies out. Rerun starts the same ecosystem again from t = 0 with your drops, planting and burning made at the start; Restart clears them and starts the field again; Reset also returns every setting to its default.
- Export. Save a PNG or record a short video or GIF of the ecosystem. Record 30 s from the start runs the same setup again from the beginning and records its first 30 seconds, frame by frame.
Frequently asked questions
What are Lotka-Volterra cycles?
Alfred Lotka and Vito Volterra independently showed in the 1920s that a simple pair of equations for predators and prey produces endless oscillations: prey grow when predators are rare, predators grow when prey are plentiful, and each population's peak follows the other's. Real records, such as the Hudson's Bay Company's lynx and snowshoe hare fur counts, show similar cycles.
Why do the populations sometimes crash to zero?
Small populations are vulnerable to bad luck: if foxes eat nearly every rabbit, or starve during a long rabbit shortage, a species can die out. Tall grass gives rabbits cover and the field is large enough that cycles in different areas fall out of step, which helps both species persist. With Reintroduce if extinct on, a few animals are added back so the experiment keeps running.
How does evolution work in the simulation?
Each newborn copies its parent's speed and vision, multiplied by a small random factor. Faster or sharper-eyed animals catch food or escape more often but spend more energy, so whichever variants leave the most offspring become more common. Over many generations the average traits drift toward a balance that depends on the other species — an evolutionary arms race.
Is this a scientific model?
It is an agent-based teaching model, similar in spirit to classic classroom simulations such as NetLogo's Wolf Sheep Predation. The numbers are not calibrated to any real species, but the mechanisms — energy budgets, predation, reproduction, resource regrowth and heritable variation — are the ones ecologists use to explain population dynamics.





