Examples

Select an example to explore it in the playground.

Beginner - Introductory Models

Fishery Simulation

A fishery simulation of stocks, flows, and feedback loops managing fish populations.

Level: Beginner

populationresource-managementsustainabilitymanagementecosystemstocks-flowsreinforcing-loopbalancing-looprenewable-resourcequota-policy

  • Stocks: population
  • Flows: births, quota
  • Feedback Loops: reproduction (reinforcing), quota (balancing)
  • Probes: population, quota, gap_to_capacity, extracted_total

Antifragile System

A simple antifragile system simulation where each failure reduces the probability of future failures.

Level: Beginner

reinforcing-loopreliability

  • Flows: failure
  • Feedback Loops: learning from failure
  • Probes: failure, failure_rate, total_failures

Bathtub Fill and Drain

A bathtub simulation illustrating stock and flow of water volume.

Level: Beginner

stocks-flowscapacity

  • Stocks: water_volume
  • Flows: inflow, outflow
  • Probes: water_volume, inflow, outflow

Gacha Box

Simulates drawing items from a gacha box with configurable drop rates and a pity system.

Level: Beginner

stochasticgamerandom

  • Probes: count_common, count_rare, count_ultra, spent

Game of Life

Conway's Game of Life producing grid frames.

Level: Beginner

cellular-automatagrid

  • Probes: alive

Goal-Seeking Decay

A goal-seeking decay simulation modeling exponential approach toward a target.

Level: Beginner

decaygoalbalancing-loopexponentialcontrolfirst-order-dynamicstime-delay

  • Stocks: level
  • Flows: approach_rate
  • Feedback Loops: goal-seeking (balancing)
  • Probes: level, approach_rate

Inventory Oscillation

Bullwhip-style swings from naive reordering with shipping delay.

Level: Beginner

inventorydelaybullwhip

  • Stocks: inventory
  • Flows: demand, shipments
  • Feedback Loops: delayed reorder overshoot
  • Probes: inventory, pipeline

Logistic Growth

A logistic growth simulation of population increase with saturation.

Level: Beginner

populationcapacitynonlinear-dynamicsreinforcing-loop

  • Stocks: population
  • Flows: growth
  • Feedback Loops: reinforcing adoption, saturation constraint
  • Probes: population, growth

Nested Hierarchy Workflow

A nested hierarchy simulation where tasks flow across company departments.

Level: Beginner

workflowcapacityresource-managementthroughputbottleneck

  • Flows: arrivals, service
  • Probes: Dept0, Dept1, Dept0-Team0, Dept0-Team1, Dept1-Team0, Dept1-Team1

Queue Simulation

A queue simulation demonstrating throughput limits and system capacity.

Level: Beginner

queuethroughputbottleneckdiscrete-eventservicecapacity

  • Stocks: backlog[p]
  • Flows: produced, consumed
  • Probes: backlog_total, incoming_per_sec, outgoing_per_sec

Rule 110

Elementary cellular automaton with complex emergent behavior.

Level: Beginner

cellular-automatagrid

  • Probes: ones

Rule 30

Elementary cellular automaton that evolves to chaotic patterns.

Level: Beginner

cellular-automatagrid

  • Probes: ones

Savings vs Credit-Card Debt

A savings vs debt simulation comparing compounding interest effects.

Level: Beginner

debtreinforcing-loopexponential

  • Stocks: savings_balance, debt_balance
  • Feedback Loops: compound interest on savings (reinforcing), compound interest on debt (reinforcing)
  • Probes: savings_balance, debt_balance

Thermostat Simulation

A thermostat simulation showing balancing feedback and time delays.

Level: Beginner

controltime-delaybalancing-loop

  • Stocks: indoor_temp
  • Flows: heat_gain, heat_loss
  • Feedback Loops: controller chasing set-point (balancing), high gain overshoot (reinforcing)
  • Probes: indoor_temp, heater_on
Intermediate - Classic Dynamics

First-Price vs. Vickrey Auctions

Repeated sealed-bid auctions comparing first-price and Vickrey rules with learning agents.

Level: Intermediate

game-theoryauctionlearningincentivesimpy

  • Probes: revenue, allocative_efficiency, truthful_bidding

Bank Renege Simulation

A bank renege simulation where customers join a queue with limited patience and may leave before service if the wait is too long.

Level: Intermediate

queueservicediscrete-eventtime-delay

  • Stocks: queue
  • Flows: served, reneged
  • Probes: wait_time, served, reneged

Dynamic Difficulty Adjustment

Adaptive encounters that track win rate to keep players challenged.

Level: Intermediate

gameplayreinforcing-loopbalancing-loopadaptivegame

  • Stocks: skill, difficulty, retention
  • Flows: practice gains, difficulty adaptation
  • Feedback Loops: skill improvement (reinforcing), challenge tuning (balancing)
  • Probes: skill, difficulty, win_rate, frustration, retention

Hospital ER Patient Flow

Queuing theory demo of patient flow through an emergency department.

Level: Intermediate

queuehealthcareresource-managementprioritization

  • Stocks: beds
  • Flows: arrivals, departures
  • Feedback Loops: staffing effects
  • Probes: wait_low, wait_med, wait_high, bed_util, lwbs, served

Inspection Game

A poacher vs. ranger game with limited patrols and adaptive poachers.

Level: Intermediate

game-theoryreinforcementmonitoring

  • Probes: catch_rate, ranger_coverage, poacher_payoff

Predator-Prey (Lotka–Volterra, SciPy)

A predator-prey simulation using the Lotka-Volterra equations.

Level: Intermediate

populationecosystemnonlinear-dynamics

  • Stocks: prey, predator
  • Flows: prey_births, predations, predator_deaths
  • Feedback Loops: predation cycle
  • Probes: prey, predator

Predator-Prey (Lotka–Volterra, SimPy)

Discrete-time SimPy approximation of the predator–prey model.

Level: Intermediate

populationecosystemnonlinear-dynamics

  • Stocks: prey, predator
  • Flows: prey_births, predations, predator_deaths
  • Feedback Loops: predation cycle
  • Probes: prey, predator

Matchmaking Queue

Simulates skill-based matchmaking with adjustable buckets, skill delta and max wait.

Level: Intermediate

matchmakingqueuegamefairness

  • Probes: queue_len, avg_wait, avg_delta

Rumor vs Counterwave

Competing rumor and fact-check messages racing across a social network.

Level: Intermediate

competing-contagionsocial-networkrumorfact-check

  • Stocks: rumor, correction
  • Flows: transmissions
  • Probes: rumor, correction

SIR Model with Vaccination

An SIR vaccination simulation modeling epidemics with optional vaccination.

Level: Intermediate

populationreinforcing-loopbalancing-loopcontrol

  • Stocks: susceptible, infected, recovered
  • Flows: infections, recoveries, vaccinations
  • Feedback Loops: disease spread (reinforcing), herd immunity (balancing)
  • Probes: susceptible, infected, recovered

Sleep Debt Simulation

A sleep debt simulation tracking caffeine, sleep patterns, and debt buildup.

Level: Intermediate

debtreinforcing-loopbalancing-loop

  • Stocks: sleep_debt_hours
  • Feedback Loops: coffee reduces sleep (reinforcing), circadian pressure triggers sleep (balancing)
  • Probes: sleep_debt, subjective_energy

War of Attrition

Two-player waiting game exploring mixed strategies and the option value of waiting.

Level: Intermediate

game-theorywaiting-gamesimpy

  • Probes: contest_length, surplus, cost_variance
Advanced - Complex Simulations

Car Service Simulation - SimPy Tutorial

A car service simulation showing priority washing with features like interrupts.

Level: Advanced

simpypriorityservicemaintenancequeueinterruptsdiscrete-eventreliabilityworkflow

  • Stocks: fuel_level, parts
  • Probes: fuel_level, wash_q, parts

Logistic Map

A logistic map simulation that iterates x_{n+1}=r*x_n*(1-x_n) to illustrate chaos.

Level: Advanced

populationnonlinear-dynamics

  • Stocks: x
  • Feedback Loops: growth with self-limiting term
  • Probes: x

Machines Simulation

A machines simulation depicting resource allocation and reliability.

Level: Advanced

reliabilityresource-managementmaintenancequeuethroughput

  • Stocks: buffer, idle-token store
  • Flows: in_rate, dispatch_rate
  • Probes: in_rate, dispatch_rate, buffer_level, breakdown, repair