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 care?

The Short Answer

SimPy is a process-based discrete-event simulation framework built on standard Python. It lets you model real-world systems—factories, hospitals, call centres, supply chains—as a series of events that happen over time.

That's the Wikipedia answer. Here's the practical one:

SimPy is how you stop guessing and start knowing.

Why SimPy Exists

Most simulation software costs thousands per year, locks you into proprietary formats, and treats customisation as an afterthought. SimPy costs nothing, runs on Python, and bends to your will.

Commercial software costs thousands; SimPy costs nothing. They charge for support; the community gives it freely. They lock you in; Python sets you free.

What Makes SimPy Different

SimPy isn't trying to be Arena or AnyLogic. It doesn't have a drag-and-drop interface. It doesn't generate pretty 3D animations out of the box. What it does have:

  1. Simplicity - Processes are just Python generators
  2. Flexibility - If you can code it, you can simulate it
  3. Integration - Works seamlessly with pandas, numpy, matplotlib, and everything else in the Python ecosystem

A Taste of SimPy

Here's a complete, working simulation in 15 lines:

import simpy

def customer(env, name, counter):
    print(f'{name} arrives at {env.now}')
    with counter.request() as req:
        yield req
        print(f'{name} gets served at {env.now}')
        yield env.timeout(5)
    print(f'{name} leaves at {env.now}')

env = simpy.Environment()
counter = simpy.Resource(env, capacity=1)
for i in range(3):
    env.process(customer(env, f'Customer {i}', counter))
env.run()

That's it. No licence key. No activation wizard. No sales call.

When to Use SimPy

SimPy shines when you need to model:

When SimPy Might Not Be the Answer

I'll be honest—SimPy isn't for everyone.

If you need a flashy 3D visualisation to impress the board, SimPy won't give you that out of the box. If you've never written a line of code, the learning curve will be steep. If your boss has already paid £50,000 for FlexSim, they probably won't let you use something free.

But if you want to actually understand your simulations—to own them, extend them, and integrate them with everything else you do—SimPy is where you start.

Getting Started

Ready to dive in? The next logical step is installing SimPy and running your first simulation.

The documentation is excellent. The community is helpful. And the price is unbeatable.


Ready to Master SimPy?

Get started with simulation in Python using SimPy with my comprehensive guide. It covers everything you need to know to build your first simulation models.

Get the SimPy Guide