This open book is a self-paced training resource that teaches you how to design, implement, and share discrete-event simulation (DES) models in Python and R as part of a reproducible analytical pipeline. It combines a step-by-step guide with complete example repositories that you can adapt for your own projects.
The material is designed for researchers, research software engineers, analysts, and postgraduate students in health and operations research who want to build transparent, trustworthy simulation models. Educators and trainers can adopt the book as a complete syllabus for a short course or reuse individual chapters as standalone teaching units (for example, sessions on RAP, testing, packaging, or sharing models), and should cite the resource when they do so in line with the provided citation below. The accompanying code is released under an MIT licence, and the text is available under a CC BY-SA 4.0 licence, allowing reuse and adaptation with appropriate attribution.
If you use the DES RAP book in your teaching, research, or training, we’d love to hear about it. Please get in touch to share how you’ve used the material, suggest improvements, or point us to example models or case studies that others might find helpful.
To get the most from this resource, you should be comfortable with basic programming in either Python or R and have some familiarity with probability and basic statistics. No prior DES experience is required: short introductions to DES, reproducible analytical pipelines, and free and open source software are provided in the “Intros” section and linked below.
An engaged learner can complete the core step-by-step guide in around 10-15 hours, including time to run the code examples and attempt the exercises. You can work through the material in order as a structured course, or dip into specific sections (such as input modelling, verification and validation, or sharing and archiving) as needed.
After working through this resource, you will be able to:
- Set up version control and reproducible environments for your DES RAP project.
- Structure your work as a package, with clear, reusable code organisation.
- Manage inputs systematically, including data, parameters, and validation.
- Build a working DES model with entities, processes, randomness, and logging.
- Carry out output analysis and experimentation, including warm-up, replications, and scenario/sensitivity analysis.
- Apply verification, validation, testing, and quality assurance to increase trust in your model.
- Improve style, documentation, and automation with linting, docstrings, and GitHub Actions.
- Collaborate and share your work effectively, including code review, licensing, citation, changelogs, and archiving.
Reproducibility frameworks
Our resources are designed to help you meet two important reproducibility standards. Learn more:
New to these concepts?
We have dedicated pages explaining the foundations, helpful if you’re new to any of these areas.
Discrete-Event Simulation Reproducible Analytical Pipelines Free & Open Source Software
This resource is an output of STARS, a research project led by Associate Prof. Tom Monks
.
The book is written by Amy Heather
. It has been reviewed by:
- Prof. Nav Mustafee

- Dr. Alison Harper

- Associate Prof. Tom Monks

- Fatemeh Alidoost

- Dr. Rob Challen

- Tom Slater

The STARS project is supported by the Medical Research Council [grant number MR/Z503915/1] from 1st May 2024 to 31st October 2026. The listed researchers are associated with the University of Exeter Medical and Business Schools, and the University of Bristol School of Engineering, Mathematics and Technology.
You can find out more about our project on the STARS project website. If you use this resource, please cite us:
Heather, A., Monks, T., Mustafee, N., Harper, A., Alidoost, F., Challen, R., & Slater, T. (2025). DES RAP Book: Reproducible Discrete-Event Simulation in Python and R. https://github.com/pythonhealthdatascience/des_rap_book. https://doi.org/10.5281/zenodo.17094155.
Keywords: discrete-event simulation; reproducible analytical pipelines; health services research; Python; R; simulation modelling; research software engineering; open-source tools; SimPy; simmer.