Model Musings
Notes from the modelling desk.
Short, practical pieces on discrete-event simulation in Python with SimPy: the patterns worth learning, the errors worth avoiding and the questions a model is actually fit to answer. Written between projects; read in minutes.
| Articles | 64 |
|---|---|
| Latest entry | 04 Mar 2026 |
| First entry | 10 Jan 2025 |
March 2026 4 articles
-
SimPy Performance Optimisation: Making Simulations Faster
Your SimPy model works, but it crawls. Profile first, then cut object churn, batch the work, run replications in parallel and simplify where it counts.
-
SimPy Deadlock Explained: Why Your Simulation Hangs
Your simulation starts, then stops: no error, no output, nothing. Why SimPy models deadlock, how to spot it and four reliable ways to prevent it.
-
SimPy Process Not Running: Why Nothing Happens
You wrote the code and ran the simulation, and nothing happened. Ten reasons a SimPy process never runs, with a checklist to find yours quickly.
-
Debugging SimPy: Finding What's Wrong
When a SimPy model misbehaves, guesswork is slow. Print tracing, logging, event tracers, breakpoints and assertions will find the fault faster.
February 2026 28 articles
-
Common SimPy Errors and How to Fix Them
Fifteen SimPy errors you will meet sooner or later, from a forgotten yield to an unset seed, with what each one means and how to fix it.
-
Optimisation with SimPy: Finding the Best Configuration
Simulation tells you what happens; optimisation tells you what is best. Grid search, scipy.optimize and genetic algorithms for tuning a SimPy model.
-
Animation in SimPy: Making Simulations Come Alive
Static charts tell a story; animation tells it better. Bring a SimPy model to life with matplotlib, Pygame, Plotly, GIF export and a live Dash app.
-
SimPy with NumPy: Better Randomness and Faster Analysis
Python's random module is fine. NumPy's random is better. More distributions. Better seeding. Faster analysis.
-
SimPy with matplotlib: Visualising Simulation Results
Numbers tell the story; matplotlib makes people believe it. Queue traces, wait distributions, utilisation charts and dashboards for SimPy results.
-
SimPy with pandas: Powerful Data Analysis for Simulation Results
SimPy generates the data; pandas makes sense of it. Collect results in DataFrames, then slice, resample, pivot and compare scenarios in a few lines.
-
Production Line Simulation with SimPy: Flow, Buffers and Bottlenecks
Production lines are sequences of stations connected by buffers. Material flows from start to finish. Bottlenecks determine throughput. Simulation finds them.
-
Warehouse Simulation with SimPy: From Receiving to Shipping
Warehouses are logistics engines: goods flow in, get stored, get picked and flow out. Simulate zones, waves and conveyors to find the bottlenecks.
-
Airport Simulation with SimPy: From Check-In to Takeoff
Passengers flow through check-in, security and boarding while delays cascade. Model an airport in SimPy and see where things go wrong before they do.
-
Machine Shop Simulation with SimPy: Jobs, Machines and Breakdowns
The machine shop is a classic simulation problem. Jobs arrive. Machines process them. Breakdowns happen. The question: can you meet your deadlines?
-
Restaurant Simulation with SimPy: From Seating to Serving
Restaurants are fascinating systems. Multiple resources. Parallel processes. Variable service times. Customer behaviour. All in one simulation.
-
Supply Chain Simulation with SimPy: From Supplier to Customer
Supply chains are networks of queues, buffers and delays. Orders flow one way and goods the other. Simulate them in SimPy to find where they stick.
-
Bank Queue Simulation with SimPy: The Classic Example
The bank queue is the Hello World of simulation: simple enough to grasp, rich enough to matter. Tellers, express lanes, balking and VIPs in SimPy.
-
Call Centre Simulation with SimPy: Optimising Customer Service
Call centres live and die by their metrics. Average wait time. Abandonment rate. Service level. Simulation helps you hit your targets without overstaffing.
-
Hospital Simulation with SimPy: Modelling Patient Flow
Hospitals are complex systems. Patients arrive unpredictably. Resources are constrained. Lives depend on getting it right. Simulation helps.
-
Manufacturing Simulation with SimPy: Modelling the Factory Floor
Manufacturing is where simulation proves its worth. Model breakdowns, kanban, batches, quality checks and shifts in SimPy to find bottlenecks early.
-
Running Multiple Processes in SimPy: Concurrency Made Simple
Real systems have many things happening at once. Customers shopping. Machines running. Trucks delivering. SimPy handles them all.
-
Running SimPy Until a Condition: Flexible Termination
Sometimes you don't know when to stop. Run until the queue is empty. Until 1000 customers are served. Until something interesting happens.
-
Real-Time Simulation with SimPy: Syncing with the Real World
Normal SimPy runs as fast as possible. Simulation years pass in seconds. But sometimes you need simulation time to match real time.
-
SimPy Interrupts Explained: Handling the Unexpected
Real systems have interruptions. Machines break. Priorities change. Shifts end. SimPy lets you model all of this with interrupts.
-
Logging in SimPy: Debugging and Tracing Your Simulations
Print statements are fine for tiny simulations; real ones need proper logging. Log levels, simulation-time loggers, event tracing and JSON output.
-
Visualising SimPy Results: Making Data Speak
Numbers tell the story; charts make people listen. The plots every SimPy study needs, from queue lengths and wait histograms to CDFs and Plotly.
-
Confidence Intervals in SimPy: Quantifying Uncertainty
A point estimate without a confidence interval is a guess with false precision. Here's how to do it properly.
-
Warm-Up Period in SimPy: Avoiding Initialisation Bias
Your simulation starts empty. Reality doesn't. This mismatch corrupts your results unless you handle it properly.
-
Running Multiple Replications in SimPy: Statistical Confidence
One simulation run proves nothing; run it again and the answer changes. How many replications you need, and how to run and compare them in SimPy.
-
Collecting Statistics in SimPy: Measuring What Matters
A simulation without statistics is just an animation. You need numbers. Trends. Distributions. Evidence.
-
Random Numbers in SimPy: Seeds, Streams and Reproducibility
Randomness is the soul of simulation. But uncontrolled randomness is chaos. Here's how to do it right.
-
Service Time Distributions in SimPy: Choosing the Right Randomness
Service times are rarely fixed, and the distribution you choose makes a model realistic or useless. How to choose, fit and sample the right one in SimPy.
January 2026 23 articles
-
Modelling Arrivals in SimPy: From Poisson to Custom Patterns
Every simulation needs entities entering the system. Customers arrive. Jobs appear. Packets flow. How you model arrivals shapes your entire simulation.
-
Modelling Servers in SimPy: From Single to Multiple
Servers are the workhorses of simulation: tills, machines, staff and computers. Model single, parallel, batch and setup-time servers in SimPy.
-
How to Model a Queue in SimPy: The Complete Guide
Queues are the bread and butter of discrete event simulation; model one well and you can model most systems. Servers, priorities, balking and statistics.
-
SimPy FilterStore Explained: Getting Exactly What You Need
Store hands you the next item; FilterStore lets you be picky. How to fetch exactly the item you need, with a parts bin and taxi dispatch as examples.
-
SimPy Store Explained: Managing Distinct Objects
Resources count slots, containers track levels and stores hold distinct items. How to pass real objects between SimPy processes with Store.
-
SimPy Container Explained: Modelling Levels and Quantities
Not everything is about counting slots. SimPy's Container models levels, such as fuel in a tank, stock in a buffer or water in a reservoir.
-
SimPy PreemptiveResource Explained: Interrupting for Priority
PreemptiveResource doesn't just jump the queue; it evicts whoever is using the resource. How preemption works in SimPy and how to handle it safely.
-
SimPy PriorityResource Explained: When Some Requests Matter More
Not all customers are equal. Not all jobs are equally urgent. PriorityResource lets important requests jump the queue.
-
SimPy Resource Explained: Modelling Limited Capacity
Resources are where queues form, waiting occurs and bottlenecks emerge. How SimPy's Resource works, from request and release to balking and reneging.
-
Python Generators Explained for SimPy Users
SimPy is built on Python generators; if they feel mysterious, SimPy will too. What yield does, how a generator keeps its state and why SimPy needs it.
-
The Yield Keyword in SimPy: Why It Matters
You will see yield everywhere in SimPy code. It is not decoration; it is the mechanism that makes simulation work. What it does and why it matters.
-
SimPy Timeout Explained: Modelling Time Delays
The timeout is the most used event in SimPy; it is how you say 'wait this long'. Random delays, time units, zero timeouts and running in real time.
-
SimPy Events Explained: How Things Happen in Simulation
Events are the heartbeat of SimPy: a timeout expires, a resource frees up, a process ends. How events work, from AnyOf and AllOf to custom events.
-
SimPy Processes Explained: The Building Blocks of Simulation
If the environment is the heart of SimPy, processes are the muscles. How to write, start, parameterise, interrupt and connect the processes in a model.
-
SimPy Environment Explained: The Heart of Every Simulation
The SimPy Environment is the least glamorous and most important part of every model: the clock, the scheduler and the coordinator all in one.
-
SimPy vs AnyLogic: Which Simulation Tool Should You Use?
AnyLogic does agent-based, system dynamics and discrete-event simulation in one package. SimPy does one of them, in Python. Which should you choose?
-
SimPy vs Arena: An Honest Comparison
Arena is the Microsoft Office of simulation software: ubiquitous, expensive and entrenched. An honest comparison with SimPy, its open-source rival.
-
When Should You Actually Use Simulation?
Simulation is powerful, but it is not always the right tool. When it earns its place, when simple maths will do and a rule of thumb for deciding.
-
SimPy in 10 Minutes: Everything You Need to Get Started
You don't need a week to learn SimPy; you need ten minutes. The mental model, the core building blocks and a complete coffee shop example to start.
-
Your First SimPy Simulation: Hello World for Discrete Event Simulation
Every programming journey starts with 'Hello World', and simulation is no different. Build your first SimPy model and watch events unfold over time.
-
How to Install SimPy (It Takes 10 Seconds)
The installation process for SimPy is not exactly complicated. Open a terminal. Run one command. Done.
-
What Is SimPy? A No-Nonsense Introduction
SimPy is the process-based discrete-event simulation library for Python. What it is, why it exists, what makes it different and whether you need it.
-
What Is Discrete Event Simulation? (And Why Should You Care?)
Discrete event simulation sounds academic. It's not. It's one of the most practical tools an engineer can learn.
July 2025 3 articles
-
How Good Is Gemini CLI vs Claude Code at Writing SimPy Simulations?
Gemini CLI and Claude Code (Opus) take on the same SimPy benchmark. Which writes the more concise, accurate simulation? The result surprised me.
-
The Dawn of Vibe Modelling: Claude Opus Nails Simulation Benchmark
Claude 4 Opus takes on a hydrogen production simulation benchmark and returns clean code and a near-perfect answer. Is this the dawn of vibe modelling?
-
How do you know your simulation's settings represent the future?
How can you be sure your simulation's settings reflect the future? Build credible models with validation, sensitivity analysis and stakeholder input.
June 2025 3 articles
-
Can you give some real world examples of discrete-event simulation?
Real-world examples of discrete-event simulation: a $50M machine purchase avoided, hospital waits cut by 30% and supply chains made leaner.
-
SimPy and Salabim: A Tale of Two Simulations
Compare Python's SimPy and salabim simulation libraries. We build an assembly line model in both to see how they tackle the same problem, side-by-side.
-
What Exactly Does SimPy Do That I Can't Do Without It?
Discover why SimPy is essential for discrete-event simulation in Python, even if you're proficient in coding. Learn about SimPy's core mechanisms.
May 2025 2 articles
-
Can You Get Very Close to Reality with Predictions from Models?
How close can a model's predictions get to reality? Closer than you might think, with sound assumptions, good data, honest validation and the right question.
-
What's the relationship between simulation and optimisation?
Simulation shows how a system behaves; optimisation searches for the best way to run it. How the two work together, with simulation feeding the search.
January 2025 1 article
-
Breathing Life into Logic: A Guide to Visualising SimPy Simulations
Turn SimPy simulations from abstract logic into compelling visual stories, with static plots, animations and professional visualisation techniques.