MemoSimagent-based modeling studio

Library/Natural and environmental sciences

Predator prey dynamics

Grass grows on patches (0–10 units).

Run in your browser Download .nlogox Get MemoSim verified in NetLogo Web · or open in MemoSim
Read the assumptions first. The model itself says it is illustrative and uncalibrated. Treat its output as a demonstration of a mechanism, not an estimate of a real system.

An illustrative, uncalibrated agent-based model of a classic predator–prey system: rabbits (prey) and foxes (predators) on a small grassy field.

Mechanism

  • Grass grows on patches (0–10 units). Each patch has a small chance per tick to regrow by 1 unit.
  • Rabbits move randomly, lose 1 energy per tick, and gain rabbit-gain energy when they eat grass on their patch. They reproduce (hatching one offspring) when their energy exceeds 25 with probability rabbit-reproduce %. They die when energy drops below 0.
  • Foxes move randomly, lose 2 energy per tick, and gain fox-gain energy when they eat a rabbit on their patch. They reproduce when energy exceeds 30 with probability fox-reproduce %. They die when energy drops below 0.
  • The interaction produces the characteristic oscillations: rabbits rise → foxes rise → rabbits fall → foxes fall → repeat.

Controls

| Parameter | Range | Default | Meaning | |---|---|---|---| | rabbit-gain | 0–20 | 6 | Energy a rabbit gains per unit of grass eaten | | fox-gain | 0–50 | 25 | Energy a fox gains per rabbit eaten | | rabbit-reproduce | 0–20 | 5 | Probability (%) a rabbit reproduces when well-fed | | fox-reproduce | 0–20 | 3 | Probability (%) a fox reproduces when well-fed |

Units

  • Energy is an abstract unit (not joules). Grass is 0–10 units per patch. Time is in ticks.

Assumptions & Limitations

  • The world is small (33×33 patches) with wrapping, so populations are bounded.
  • Movement is random; there is no pursuit or avoidance behaviour.
  • Reproduction is a simple probability gate, not a biological lifecycle.
  • No disease, migration, age structure, or spatial heterogeneity beyond grass.
  • The model is illustrative only and is not calibrated to any real ecosystem. It is a teaching tool for understanding coupled population dynamics.
Field
Natural and environmental sciences
Model file
Predator-prey-dynamics-4c5d4bb47335.nlogox · 39 KB
Controls
rabbit-gain, fox-gain, rabbit-reproduce, fox-reproduce
Reporters
none recorded
Procedures
setup, go, move, hunt, recolor
Experiment
none pinned in this file
Documentation
4/7 · 279 words in the Info tab