This practical guide shows you how to build reproducible discrete-event simulation models (DES) that fit into a reproducible analytical pipeline (RAP), with tips that benefit all types of models and analysis.
Key features include:
Dual Implementation: Every concept is demonstrated with working code examples in both Python (SimPy) and R (simmer), allowing you to learn in your preferred language.
Example repositories: The book includes practical case studies like M/M/s queueing models and a stroke capacity planning model, implementing all the book recommendations and available as separate GitHub repositories.
Built on Research: Follows recommendations from peer-reviewed research on reproducibility in healthcare DES, and the NHS RAP Community of Practice Levels of RAP.
Interactive Learning: Structured as a Quarto website with searchable content, code examples you can copy, and clear explanations suitable for beginners through advanced users.
Book contents
| Section | Pages |
|---|---|
| Introduction | Discrete-event simulation (DES) Reproducibility and RAPs Guidelines Open-source languages Example conceptual models |
| Setup | Version control Environments Structuring as a package Code organisation |
| Model inputs | Input modelling Input data management Parameters from script Parameters from file Parameter validation |
| Model building | Randomness Entity generation Entity processing Logging |
| Output analysis | Initialisation bias Performance measures Replications Length of warm-up Number of replications Parallel processing |
| Experimentation | Scenario and sensitivity analysis Tables and figures Full run |
| Style and documentation | Linting Docstrings GitHub actions Documentation |
| Collaboration & sharing | Code review Licensing Citation Changelog Sharing and archiving |
View the book
To view the book, click on the image below or go to https://pythonhealthdatascience.github.io/des_rap_book/.
Project status
Status: Gold
Rationale: This resource guides users in building “Gold” standard models - well-documented, tested, and structured as packages - with four complete examples illustrating these best practices.
