The SimPy playground

Nine industries, one browser tab.

What does a discrete-event simulation actually look like? Pick a system below, a steel plant, a port, a satellite network, and find out. Python, SimPy and the plotting stack load directly in your browser; adjust the parameters, edit the code if the mood takes you and press run. Nothing to install, nothing to break.

Python stays put until you first press run. Then it downloads, about 20 MB of it, so the first run can take a minute or so. Worth putting the kettle on.

Examples Nine: steel, shipping, satellites, aircraft, military supply, building climate and three in insurance
Runs in Your browser: Python, SimPy and the plotting stack
To install Nothing

Steel production plant simulation

This simulation models a steel production facility with multiple furnaces processing steel batches. The simulation demonstrates:

  • Resource allocation and contention (furnaces)
  • Process times with variability
  • Queue management and waiting times
  • Production throughput analysis

Adjust the parameters below to see how different configurations affect production efficiency and resource utilisation.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Shipping logistics simulation

This simulation models a shipping port with multiple berths handling container ships. The simulation demonstrates:

  • Port berth utilisation
  • Ship arrival patterns and queuing
  • Loading/unloading time variability
  • Port throughput optimisation

Experiment with different numbers of berths and ship arrival rates to optimise port operations.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Satellite communication network

This simulation models a satellite communication network managing data transmission requests. The simulation demonstrates:

  • Satellite channel allocation and bandwidth management
  • Data packet transmission with varying priorities
  • Network congestion and latency analysis
  • Ground station coordination

Experiment with different numbers of satellites and data loads to optimise network performance.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Aircraft turnaround operations

This simulation models airport ground operations for aircraft turnaround between flights. The simulation demonstrates:

  • Gate allocation and aircraft parking
  • Parallel ground services (fuelling, catering, cleaning, baggage)
  • Turnaround time optimisation
  • Resource scheduling and coordination

Adjust parameters to minimise turnaround times while managing limited ground resources.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Military supply chain

This simulation models a military supply chain network with multiple forward operating bases (FOBs). The simulation demonstrates:

  • Multi-echelon inventory management
  • Supply convoy scheduling and routing
  • Emergency resupply prioritisation
  • Resource allocation under constraints

Experiment with different supply strategies to maintain operational readiness across all bases.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Building climate control

This simulation models an HVAC system managing climate control for a multi-zone building. The simulation demonstrates:

  • Zone temperature regulation and control
  • Energy consumption optimisation
  • Occupancy-based climate adjustment
  • Peak load management and efficiency

Adjust parameters to balance comfort levels with energy efficiency across different building zones.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Multi-year guaranteed annuity (MYGA)

This simulation models a portfolio of Multi-Year Guaranteed Annuities (MYGAs). The simulation demonstrates:

  • Interest accumulation at a guaranteed rate
  • Policyholder behaviour, including lapses (surrenders)
  • Cash flow analysis for an insurance company
  • Portfolio valuation over time

Adjust the parameters to see how interest rates and policyholder behaviour impact the growth and stability of the annuity portfolio.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Actuarial pricing

This simulation models the process an actuary uses to price an insurance premium for a portfolio of policies. It uses a Monte Carlo approach to simulate one year of claims activity many times to understand the range of possible outcomes. The simulation demonstrates:

  • Modelling claim frequency and severity
  • Calculating pure premium based on expected losses
  • Applying a loading factor for expenses and profit
  • Analysing the risk of the insurance portfolio

Adjust the parameters to see how claim characteristics and business assumptions affect the final premium and the insurer's risk.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Actuarial reserving

This simulation models the process of establishing reserves for insurance claims. It simulates claims occurring in a single "accident year" and tracks how they are reported and paid over subsequent "development years". This helps estimate IBNR (Incurred But Not Reported) reserves. The simulation demonstrates:

  • Modelling reporting and payment delays for claims
  • Tracking the development of paid losses over time
  • Estimating ultimate losses for an accident year
  • Calculating the required reserves (Outstanding Claims)

Adjust the parameters to see how claim delays and other factors influence the loss development pattern and the size of the required reserves.

Simulation parameters

Simulation code

Tab indents; press Esc, then Tab, to leave the editor.

Output

Press “Run simulation” to see the results.

Disclaimer: These simulations are proof-of-concept examples for educational purposes and should not be used for real-world decision-making.

Free book

Would you like a copy of my book on Simulation in Python with SimPy?

Enter your email below and I will send it straight to your inbox.

The toys end here; the craft starts there.

These examples are deliberately small: proofs of concept, not decision tools. The Simulation Bootcamp teaches you to build the real thing, from scoping a study to results a board will trust.