A Practical Guide to SimPy and Discrete Event Simulation 💻
SimPy is one of Python’s most useful libraries for building discrete event simulation models, but its process-oriented style can take time to master. In SimPy: Simulation in Python, Afonso C. Medina turns that learning curve into a sequence of short, practical sections designed to introduce one concept at a time.
The book moves from setup to working examples. You’ll see how to create a simulation environment, generate arrivals, work with timeouts, and run models for defined periods. Along the way, Medina introduces resources, priority and preemptive resources, process interruptions, stores, containers, and the event system that makes SimPy flexible.
Hands-On Challenges and Worked Solutions
Rather than leaving concepts abstract, the book includes challenge sections with solutions and short quizzes. The M/M/1 queue appears as a complete example, bringing arrival generation, service times, and resource usage together in a recognizable simulation scenario.
From Core Mechanics to Agent-Based Models
Later chapters go deeper into SimPy’s event model, callbacks, generator functions, and performance considerations. A full agent-based SIR epidemic model shows how to use these building blocks for more realistic population-level simulations. There’s also guidance on reading and writing spreadsheet data, which helps connect SimPy models to wider workflows.
Who This Book Is For
This is not a general introduction to simulation methodology. Medina assumes readers already have some background in discrete event modeling or are studying the subject, perhaps alongside Chwif and Medina’s Modeling and Simulation of Discrete Events. The focus here is on using SimPy itself: how the library works, how to structure models, and how to solve common implementation problems.
Because this edition is published through Leanpub, the text is updated periodically with corrections, improvements, and additional content. That makes the digital format especially practical for readers who want a living reference rather than a static snapshot. If you’re ready to build clearer, more maintainable simulation models in Python, this guide offers a direct route.
User Reviews
Only logged in customers who have purchased this product may leave a review.
Original price was: $5.00.$2.50Current price is: $2.50.

There are no reviews yet.