HomeArticlesEcology & Conservation Biology

Wolf-Sheep Predation: Lotka-Volterra Cycles in a Grid

How individual sheep and wolves following simple local rules reproduce the classic predator-prey boom-and-bust cycle without any global equation telling them to.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

Predator, prey, and a patch of grass

Wolf-sheep predation is the classic agent-based counterpart to the Lotka–Volterra equations: instead of tracking two smooth population numbers, thousands of individual sheep and wolves move around a grid, eat, reproduce and die according to a handful of local rules, and the population cycles emerge from those individual interactions rather than being written into the model directly. Sheep wander the grid eating grass (which regrows after a delay), gaining energy each bite; wolves wander and eat sheep; every agent loses energy each tick and reproduces above an energy threshold, dying if its energy reaches zero.

live demo · agents moving and interacting on a spatial grid● LIVE

Why booms are followed by busts

When sheep are abundant, wolves eat well, gain energy quickly and reproduce faster than they die — the wolf population grows. But more wolves means more predation pressure, so the sheep population falls. Fewer sheep means less food for wolves, so wolves start starving and dying faster than they can reproduce — the wolf population falls in turn. With fewer wolves, sheep predation pressure eases and the grass-fed sheep population recovers, and the whole cycle repeats. This is exactly the oscillating out-of-phase cycle that Alfred Lotka and Vito Volterra derived analytically in the 1920s for continuous population densities:

dS/dt =  a·S − b·S·W     (sheep: growth − predation)
dW/dt =  c·S·W − d·W     (wolves: predation-fed growth − death)

S = sheep, W = wolves, a,b,c,d > 0
peaks in W trail peaks in S by a quarter-cycle

The spatial, individual version reproduces this qualitative pattern — sheep peaks, then a delayed wolf peak, then a crash of both — but adds effects the smooth equations cannot: local depletion (a patch of grass or sheep can be wiped out in one region while thriving elsewhere), stochastic extinction when a population gets small enough that random chance finishes it off, and spatial refuges where prey escape predators simply by distance.

Grass as the hidden third species

Because grass regrows on a fixed timer rather than being infinite, it behaves as a third trophic level and adds its own delay to the cycle: a sheep boom can outstrip the grass regrowth rate, causing a sheep crash from starvation even without extra wolves, which is a dynamic pure two-species Lotka–Volterra cannot show. Models with this extra layer are closer to real predator-prey-vegetation systems, such as the well-documented snowshoe hare and Canada lynx cycle, than the idealised two-equation version.

Emergence and the limits of local rules

No agent in the simulation knows about "population cycles" — each one only ever asks is there food adjacent to me, and do I have enough energy to reproduce. The cyclic boom-and-bust pattern, and the eventual risk of total extinction if parameters are tuned wrong (wolves too efficient, grass regrowth too slow), are emergent properties of many local interactions, which is exactly why agent-based models are used across ecology, epidemiology and economics whenever the interesting behaviour comes from heterogeneity and locality that a single averaged equation would erase.

Frequently asked questions

Why does the wolf population always peak after the sheep population?

Wolves need to actually catch and eat sheep before their numbers can grow, so wolf reproduction lags behind sheep abundance. By the time wolves have multiplied in response to a sheep boom, the boom is already being eaten down — producing the characteristic delayed, out-of-phase cycle.

Can the sheep or wolves go permanently extinct?

Yes. If wolves are too efficient or too numerous relative to sheep, sheep can be wiped out entirely, which then starves the wolves too. Because this model is spatial and stochastic, extinction can also happen by chance in a small population even when the average dynamics look stable.

How is this different from the classic Lotka-Volterra equations?

Lotka-Volterra tracks two smooth population densities with no space or individuals. This simulation gives every sheep and wolf its own position and energy on a grid, with grass that regrows over time, so local depletion, spatial refuges and random extinction all appear naturally instead of being assumed away.

Try it live

Everything above runs in your browser — open Wolf-Sheep Predation and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Wolf-Sheep Predation simulation

What did you find?

Add reproduction steps (optional)