Examplesllms.txt

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

The same adaptive loop, two fates: with one knob negative each failure makes the system stronger; flip its sign and failures spiral to certain breakdown.

Level: Beginner

reinforcing-loopbalancing-loopreliabilityantifragility

  • Stocks: failure_rate, total_failures
  • Flows: failure
  • Feedback Loops: antifragile healing (balancing), fragile spiral (reinforcing)
  • Probes: 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

Elementary Cellular Automata

One 8-bit rule number, three worlds: flip it to walk a single-line automaton from an ordered fractal through Turing-complete complexity to deterministic chaos.

Level: Beginner

cellular-automatagridcomputationchaos

  • Probes: ones, clusters, center_fraction

Gacha Box

Same 50 pulls, same spend, one setting apart: a pity timer guarantees the 1%-odds ultra after a dry streak, while turning it off can leave you empty-handed.

Level: Beginner

stochasticgamerandompity-timerprobability

  • Probes: count_common, count_rare, count_ultra, spent, draws_since_top

Game of Life

Conway's Game of Life: a random soup self-organizes into still-lifes, blinkers, and gliders — global order from one local rule.

Level: Beginner

cellular-automatagridemergenceself-organization

  • Probes: alive, changed

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

Naive reordering that ignores in-transit stock makes inventory swing; counting the pipeline flattens it.

Level: Beginner

inventorydelaybullwhip

  • Stocks: inventory
  • Flows: demand, shipments
  • Feedback Loops: delayed reorder (balancing loop that overshoots)
  • Probes: inventory, pipeline

Logistic Growth

Grow a population too fast and it overshoots its carrying capacity before settling; grow it gently and it glides up to the same limit.

Level: Beginner

populationcapacityovershootnonlinear-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 single-server queue at the edge of overload: nudge utilization past 1 and the backlog diverges.

Level: Beginner

queuethroughputbottleneckdiscrete-eventservicecapacity

  • Stocks: backlog
  • Flows: arrivals, served
  • Probes: backlog, utilization, throughput

Savings vs Credit-Card Debt

Same card, same income - one number decides everything: pay just under the interest and the debt runs away; pay just over it and the balance marches to zero.

Level: Beginner

debtreinforcing-loopexponentialcompounding

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

Thermostat Simulation

A bang-bang thermostat reading a delayed sensor overshoots and rings; shorten the delay and it settles.

Level: Beginner

controltime-delaybalancing-loop

  • Stocks: indoor_temp
  • Flows: heat_gain, heat_loss
  • Feedback Loops: controller chasing set-point (balancing)
  • Probes: indoor_temp, error, 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

At a teller running near capacity, patience decides everything: impatient customers give up before a line even forms - half walk out - while patient ones build a long queue yet nearly all get served.

Level: Intermediate

queueservicediscrete-eventreneging

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

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 ranger who patrols just 40% of sites can still stop poaching - but only if the penalty is harsh enough. Soften it and the same patrols let crime pay.

Level: Intermediate

game-theoryreinforcementmonitoringdeterrence

  • Feedback Loops: poacher adaptation (reinforcement)
  • 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

Ride-Share Surge Control

Dynamic pricing stabilises rider waits—until high gain and delay turn it into surge whiplash.

Level: Intermediate

queuepricingelasticitybalancing-loopdelayoscillation

  • Stocks: Riders Waiting, Idle Drivers, Drivers on Trip
  • Flows: Passenger Arrivals, Driver Logins, Matches, Trip Completions, Driver Logouts
  • Feedback Loops: Wait-driven surge (balancing), High-gain with delay (reinforcing oscillation)
  • Probes: price_multiplier, wait_estimate, riders_waiting, idle_drivers, arrival_rate, driver_logins, matches_per_min

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 epidemic at the threshold: vaccinating past the herd-immunity line pushes effective R0 below 1 and the outbreak fizzles.

Level: Intermediate

populationreinforcing-loopbalancing-loopcontrol

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

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

Water Heater PID Control

PID control keeps a domestic hot water tank near its setpoint while balancing heater power and losses.

Level: Intermediate

pid-controlthermostatenergybalancing-loophouseholdcontrol-systemstemperature

  • Stocks: water_temperature
  • Flows: heater_input, heat_loss
  • Feedback Loops: PID control (balancing)
  • Probes: temperature, heater_output, error, setpoint
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