Interactive tool

Predator–Prey Encounter Simulator

How does prey behaviour change how fast predators eat? Adjust how prey flee, school or hide, and how predators search, turn, strike and digest, then watch the encounters unfold and measure the predator's functional response, all in your web browser.

Simulator

Watch predators search, chase and strike

Animals
predator (ring = detection distance; grey = handling or full) prey fleeing prey prey in a refuge type-2 prey

View from above of a cube of space that wraps around at its edges; fainter prey are deeper. Distances are in predator detection distances, and time is in time units (the time a predator takes to swim one detection distance at full speed).

–captures / predator / time unit
–chases ending in capture
–mean chase length (time units)
–encounter rate ÷ no-behaviour value
–predator time searching / chasing / handling
–prey time spent fleeing
–captures since last change
–time units since last change

Switch each mechanism on or off, and change any value. The ↺ button next to a value restores its suggested default.

Functional response

How does intake change with prey density?

A density sweep runs the current settings at eight prey densities and fits a type II functional response, f = a·n / (1 + a·h·n). Change one behaviour and sweep again to see whether it changes the attack rate a (the initial slope), the effective handling time h (which sets the plateau) or the shape of the curve. When points fall systematically below the line at low density and above it in the middle, as with refuges, the response is sigmoid (type III) rather than type II.

Each sweep takes from a few seconds to about a minute, depending on your settings.

Settingsahmax intake
How it works

An individual-based model of encounter and capture

Detect and pursue

Predators

Predators search with a correlated random walk, chase the nearest prey within their detection distance and strike on contact. Captures are detected along each step's path, so results do not depend on the time step. Handling, missed strikes, turning limits and a full gut all take predators out of the hunt.

Flee, school or hide

Prey

Prey flee when a predator comes within their flight-initiation distance. They can school, pass alarm to neighbours, confuse a striking predator, scatter in a flash expansion, escape at the optimal angle, or hide in a limited number of refuges.

Measure

Functional response

Without behaviour, the model reproduces the mass-action encounter rate. With behaviour, it shows which traits change the attack rate, which change handling time and which change the shape of the curve, such as refuges producing a sigmoid (type III) response.

This page runs a JavaScript version of the core rules of the EncounterABM model for exploration and teaching. Results reported in the accompanying manuscript come from the Julia model on GitHub, against which this version was checked.