The notebookModel 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.
- Read
SimPy Performance Optimization: Making Simulations Faster
Your simulation works. But it's slow. Here's how to fix that.
- Read
SimPy Deadlock Explained: Why Your Simulation Hangs
Your simulation starts. Then stops. No error. No output. Just... nothing.
- Read
SimPy Process Not Running: Why Nothing Happens
You wrote the code. You ran the simulation. Nothing happened.
- Read
Debugging SimPy: Finding What's Wrong
Something's broken. You need to find it. Here's how.
- Read
Common SimPy Errors and How to Fix Them
Every SimPy error message has a story. Here are the ones you'll meet.
- Read
Optimisation with SimPy: Finding the Best Configuration
Simulation tells you what happens. Optimisation tells you what's best.
- Read
Animation in SimPy: Making Simulations Come Alive
Static charts tell a story. Animation tells it better. Watch your simulation unfold in real time.
- Read
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.
- Read
SimPy with matplotlib: Visualising Simulation Results
Numbers tell the story. Visualisations make people believe it.
- Read
SimPy with pandas: Powerful Data Analysis for Simulation Results
SimPy generates data. pandas makes sense of it. Together, they're unstoppable.
- Read
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.
- Read
Warehouse Simulation with SimPy: From Receiving to Shipping
Warehouses are logistics engines. Goods flow in, get stored, get picked, and flow out. Simulation reveals the bottlenecks between receive and ship.
- Read
Airport Simulation with SimPy: From Check-In to Takeoff
Airports are complex systems under constant pressure. Passengers flow through multiple touchpoints. Delays cascade. Simulation helps you see where things go...
- Read
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?
- Read
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.
- Read
Supply Chain Simulation with SimPy: From Supplier to Customer
Supply chains are networks of queues, buffers, and delays. Orders flow one way. Goods flow the other. Simulation reveals where they get stuck.
- Read
Bank Queue Simulation with SimPy: The Classic Example
The bank queue is the "Hello World" of simulation. It's simple enough to understand, complex enough to be interesting, and applicable to dozens of other...
- Read
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.
- Read
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.
- Read
Manufacturing Simulation with SimPy: Modelling the Factory Floor
Manufacturing is where simulation proves its worth. Every minute of downtime costs money. Every bottleneck limits output. SimPy helps you find them before they...
- Read
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.
- Read
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.
- Read
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.
- Read
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.
- Read
Logging in SimPy: Debugging and Tracing Your Simulations
Print statements are fine for tiny simulations. Real simulations need proper logging.
- Read
Visualising SimPy Results: Making Data Speak
Numbers tell the story. Visualisations make people listen.
- Read
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.
- Read
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.
- Read
Running Multiple Replications in SimPy: Statistical Confidence
One simulation run proves nothing. Run it again—different results. Which is right? Both. Neither. You need replications.
- Read
Collecting Statistics in SimPy: Measuring What Matters
A simulation without statistics is just an animation. You need numbers. Trends. Distributions. Evidence.
- Read
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.
- Read
Service Time Distributions in SimPy: Choosing the Right Randomness
Service times—how long things take—are rarely fixed. Choosing the right distribution makes your simulation realistic or useless.
- Read
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.
- Read
Modelling Servers in SimPy: From Single to Multiple
Servers are the workhorses of simulation. Tills, machines, staff, computers—anything that processes entities and takes time.
- Read
How to Model a Queue in SimPy: The Complete Guide
Queues are the bread and butter of discrete event simulation. Customers waiting. Jobs pending. Packets buffering. If you can model a queue, you can model...
- Read
SimPy FilterStore Explained: Getting Exactly What You Need
Store gives you the next item. FilterStore lets you be picky.
- Read
SimPy Store Explained: Managing Distinct Objects
Resources count slots. Containers track levels. Stores hold distinct items.
- Read
SimPy Container Explained: Modelling Levels and Quantities
Not everything is about counting slots. Sometimes you need to model levels—fuel in a tank, items in a buffer, water in a reservoir. That's what Container is...
- Read
SimPy PreemptiveResource Explained: Interrupting for Priority
PreemptiveResource is the aggressive sibling of PriorityResource. It doesn't just jump the queue—it kicks out whoever's currently using the resource.
- Read
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.
- Read
SimPy Resource Explained: Modelling Limited Capacity
Resources are where the interesting stuff happens. Queues form. Waiting occurs. Bottlenecks emerge.
- Read
Python Generators Explained for SimPy Users
SimPy is built on Python generators. If generators feel mysterious, SimPy will too. Let's fix that.
- Read
The Yield Keyword in SimPy: Why It Matters
If you've looked at any SimPy code, you've seen yield everywhere. It's not decoration—it's the mechanism that makes simulation work.
- Read
SimPy Timeout Explained: Modelling Time Delays
The timeout is the most frequently used event in SimPy. It's how you say "wait for X time units."
- Read
SimPy Events Explained: How Things Happen in Simulation
Events are the heartbeat of SimPy. Every time something happens—a timeout expires, a resource becomes available, a process completes—that's an event.
- Read
SimPy Processes Explained: The Building Blocks of Simulation
If the environment is the heart of SimPy, processes are the muscles. They do the actual work.
- Read
SimPy Environment Explained: The Heart of Every Simulation
The SimPy Environment is the least glamorous and most important part of every simulation. It's the clock, the scheduler, and the coordinator all in one.
- Read
SimPy vs AnyLogic: Which Simulation Tool Should You Use?
AnyLogic is the Swiss Army knife of simulation—it does agent-based, system dynamics, and discrete-event simulation in one package. SimPy does discrete-event...
- Read
SimPy vs Arena: An Honest Comparison
Arena is the Microsoft Office of simulation software—ubiquitous, expensive, and often used because it's what everyone else uses. SimPy is the open-source...
- Read
When Should You Actually Use Simulation?
Simulation is powerful. But it's not always the right tool.
- Read
SimPy in 10 Minutes: Everything You Need to Get Started
You don't need a week to learn SimPy. You need ten minutes and this guide.
- Read
Your First SimPy Simulation (Hello World for Discrete Event Simulation)
Every programming journey starts with "Hello World." Simulation is no different—except instead of printing text, we're modelling events over time.
- Read
How to Install SimPy (It Takes 10 Seconds)
The installation process for SimPy is not exactly complicated. Open a terminal. Run one command. Done.
- Read
What Is SimPy? A No-Nonsense Introduction
If you've ever Googled "discrete event simulation Python," you've probably stumbled across SimPy. But what actually is it? And more importantly, should you...
- Read
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.
- Read
How Good is Gemini CLI vs Claude Code at Writing Simulations in Python with SimPy?
A head-to-head comparison of Gemini CLI and Claude Code (Opus) for writing SimPy simulations. Discover which AI tool comes out on top for conciseness, accuracy, and intelligence.
- Read
The Dawn of Vibe Modelling: Claude Opus Nails Simulation Benchmark
Explore the new era of 'vibe modelling' as Claude 4 Opus excels in a complex simulation benchmark, delivering clean code and near-perfect results. Is this the future of simulation?
- Read
How do you know the settings you use in your simulation are representative of the future real world?
How can you be sure your simulation's settings reflect the future? Learn to build credible models through validation, sensitivity analysis and stakeholder engagement.
- Read
Can you give some real world examples of discrete-event simulation?
Discover real-world examples of discrete-event simulation. See how it saved one firm $50M, cut hospital wait times by 30%, and optimized supply chains.
- Read
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.
- Read
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.
- Read
Can You Get Very Close to Reality with Predictions from Models?
Explore how close predictive models can get to reality. Understand the factors influencing model accuracy and their role in decision-making and systems thinking.
- Read
What's the relationship between simulation and optimisation?
Explore the distinct roles and synergistic relationship between simulation and optimisation. Learn how simulation models provide data to guide optimisation efforts.
- Read
Breathing Life into Logic: A Guide to Visualising SimPy Simulations
Transform your SimPy simulations from abstract logic into compelling visual stories. Learn static plots, animations, and professional visualisation techniques.