Wolves and Sheep

Sheep eat grass, wolves eat sheep, and the two populations rise and fall in coupled cycles.

Animation of the Wolves and Sheep model running in Stigmery

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.

Volterra, V. (1926). Fluctuations in the abundance of a species considered mathematically. Nature, 118, 558-560; Lotka, A. J. (1925). Elements of Physical Biology. Williams & Wilkins.

How it works

  1. Each animal moves to a nearby cell and loses a little energy.
  2. A sheep on grass eats it and gains energy; that patch starts a regrowth timer.
  3. A wolf on a sheep eats it and gains energy; the sheep is removed.
  4. An animal that passes its reproduction roll spawns offspring and shares its energy.
  5. 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 →

Related models