Predator Prey Ecosystem 

Predator - prey ecosystem



Natural ecologies can be studied as in terms of interactions between predators and their prey. The population sizes of both species can fluctuate as a consequence of births, consumption and mortality.

The goal of this project is to model predator-prey population dynamics. It can be extended with local reproduction to study the influence of space on population dynamics.

Model description

  • Create two populations: food (prey) and food-seekers (predators).
  • Give individuals of both populations a variable called 'energy'
  • Collisions between a prey and a predator result in transferral of 'energy'
  • Let prey reproduce periodically and logistically (i.e. probability of successful reproduction decreases as prey population size increases).
  • Let predators reproduce when their energy >= some reproduction threshold.
  • Prey and predators die when energy <= 0.0


Offspring can be placed either:

  • in a random place
  • close to its parent

In the first case, the populations are roughly uniformly distributed in the environment. This model approaches the behavior of traditional model of population dynamics (e.g. Lotka-Volterra system).

In the second case, the populations are clustered in space, which alters the population dynamics.

Comparison of these models shows the influence of space on population dynamics.

On the forum:
Open source