Wolves and Sheep
Sheep eat grass, wolves eat sheep, and the two populations rise and fall in coupled cycles.
Introduction
Every animal carries an energy budget: moving costs energy, eating restores it, and reaching zero means death. Sheep graze regrowing grass and wolves hunt sheep, each reproducing at a fixed chance. From these local rules the populations can settle, oscillate, or crash, the agent-based echo of the classic predator-prey equations.
Background
The model is the individual-based counterpart of the Lotka-Volterra equations, derived independently by Alfred Lotka (1925) and Vito Volterra (1926) to explain why predator and prey numbers swing out of phase. Here the smooth equations are replaced by discrete animals moving on a grid.
How it works
- Each animal moves to a nearby cell and loses a little energy.
- A sheep on grass eats it and gains energy; that patch starts a regrowth timer.
- A wolf on a sheep eats it and gains energy; the sheep is removed.
- An animal that passes its reproduction roll spawns offspring and shares its energy.
- Any animal at zero energy dies; grass reappears once its timer elapses.
Parameters
sheep_gain / wolf_gain- Energy gained per meal. Higher gains let a population grow faster and swing harder.
sheep_repro / wolf_repro- Per-tick chance of breeding. Small changes can flip the system between stable cycles and a crash.
regrowth_time- Ticks before eaten grass returns, the food supply that caps the whole food chain.
Open this model in the editor →