Example SimulationsEcology: Three-Species Food Chain

Ecology: Three-Species Food Chain

This scenario simulates a simple food chain with three populations (two prey species and one predator). It helps explain how adding one extra layer of interaction can create more complex dynamics than predator–prey alone.

What you’re simulating

  • Two prey populations compete indirectly because they share a predator.
  • The predator’s success depends on the combined availability of prey.
  • Small parameter changes can shift the system between stable coexistence, predator collapse, or prey dominance.

Run it (web UI)

  1. Open Examples
  2. Choose Ecology → Three‑Species Food Chain
  3. Click Run

Run it (local SimUI)

From the B‑Simulant library repo:

pip install "bsim[ui]"
python examples/ecology_simui_demo.py --mode three-species --port 8765

Open http://localhost:8765/ui/.

What results to expect

  • Population over time: you may see multi-phase patterns (one prey rises while the other falls).
  • Regime changes: after some time, the system can move into a different “rhythm”.

Parameter presets (and what they mean)

GoalStepsdtExpected resultWhat it means
Quick preview8000.1Early dynamics; one species may “win” briefly.Short runs can be misleading in multi‑species systems.
Standard run3,0000.1Richer patterns than predator–prey; possible multi‑cycle behavior.Extra interactions add degrees of freedom → less predictable trajectories.
Longer horizon15,0000.1Possible regime shifts (a different rhythm later).“Long-run” behavior matters: coexistence vs domination vs collapse.
Smoother curves7,5000.05Similar patterns, smoother plots.Smaller dt helps reduce numerical noise when multiple processes interact.

What to try (and why)

  • Increase Steps to see whether the system settles or keeps shifting.
  • Compare against Predator–Prey: note how “extra degrees of freedom” change predictability.

If the UI provides environment controls (like temperature/seasonality), treat them like “external pressure” and watch which population becomes dominant and whether coexistence remains possible.