https://github.com/pythonhealthdatascience/rap_des
Documentation supporting template reproducible analytical pipelines (RAP) for simple python and R discrete-event simulation (DES) models.
https://github.com/pythonhealthdatascience/rap_des
discrete-event-simulation healthcare healthcare-analysis python r reproducible-analysis reproducible-analytical-pipeline reproducible-analytical-pipelines reproducible-research reproducible-science simmer simpy simulation simulation-framework simulation-model simulation-modeling simulation-modelling template
Last synced: 3 months ago
JSON representation
Documentation supporting template reproducible analytical pipelines (RAP) for simple python and R discrete-event simulation (DES) models.
- Host: GitHub
- URL: https://github.com/pythonhealthdatascience/rap_des
- Owner: pythonhealthdatascience
- License: mit
- Created: 2024-12-05T14:48:26.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-10T16:56:40.000Z (7 months ago)
- Last Synced: 2025-03-20T12:29:41.326Z (4 months ago)
- Topics: discrete-event-simulation, healthcare, healthcare-analysis, python, r, reproducible-analysis, reproducible-analytical-pipeline, reproducible-analytical-pipelines, reproducible-research, reproducible-science, simmer, simpy, simulation, simulation-framework, simulation-model, simulation-modeling, simulation-modelling, template
- Homepage:
- Size: 60.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reproducible Discrete-Event Simulation (DES)

Simple templates and example of implementations of DES models in **Python and R**, within a **reproducible analytical pipeline (RAP)**
> ⚠️ **Work in progress**
## 📌 Introduction
TBC. Notes:
* Link to template repositoryes
* Link to STARS.
* Link to relevant publication.
## 🧐 What are we modelling?
A **simulation** is a computer model that mimics a real-world system. It allows us to test different scenarios and see how the system behaves. One of the most common simulation types in healthcare is **discrete-event simulation (DES)**.
In DES models, time progresses only when **specific events** happen (e.g., a patient arriving or finishing treatment). Unlike a continuous system where time flows smoothly, DES jumps forward in steps between events. For example, when people (or tasks) arrive, wait for service, get served, and then leave.

*Simple model animation created using web app developed by Sammi Rosser (2024) available at https://github.com/hsma-programme/Teaching_DES_Concepts_Streamlit and shared under an MIT Licence.*One simple example of a DES model is the **M/M/s queueing model**, which is implemented in this template. In a DES model, we use well-known **statistical distributions** to describe the behaviour of real-world processes. In an M/M/s model we use:
* **Poisson distribution** to model patient arrivals - and so, equivalently, use an **exponential distribution** to model the inter-arrival times (time from one arrival to the next)
* **Exponential distribution** to model server times.These can be referred to as Markovian assumptions (hence "M/M"), and "s" refers to the number of parallel servers available.
For this M/M/s model, you only need three inputs:
1. **Average arrival rate**: How often people typically arrive (e.g. patient arriving to clinic).
2. **Average service duration**: How long it takes to serve one person (e.g. doctor consultation time).
3. **Number of servers**: How many service points are available (e.g. number of doctors).This model could be applied to a range of contexts, including:
| Queue | Server/Resource |
| - | - |
| Patients in a waiting room | Doctor's consultation
| Patients waiting for an ICU bed | Available ICU beds |
| Prescriptions waiting to be processed | Pharmacists preparing and dispensing medications |For further information on M/M/s models, see:
* Ganesh, A. (2012). Simple queueing models. University of Bristol. https://people.maths.bris.ac.uk/~maajg/teaching/iqn/queues.pdf.
* Green, L. (2011). Queueing theory and modeling. In *Handbook of Healthcare Delivery Systems*. Taylor & Francis. https://business.columbia.edu/faculty/research/queueing-theory-and-modeling.
## 📖 Viewing this book
TBC. Notes on:
* View it online
* View it locally```
# Clone project
git clone https://github.com/pythonhealthdatascience/rap_des
cd rap_des# Create conda environment
conda env create --file environment.yaml
```
## 📝 Citation
| Contributor | ORCID | GitHub |
| --- | --- | --- |
| Amy Heather | [](https://orcid.org/0000-0002-6596-3479) | https://github.com/amyheather |
## 📜 Licence
This template is licensed under the MIT License.
```
MIT LicenseCopyright (c) 2024 STARS Project Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
## 💰 Funding
This project was developed as part of the project STARS: Sharing Tools and Artefacts for Reproducible Simulations. It is supported by the Medical Research Council [grant number [MR/Z503915/1](https://gtr.ukri.org/projects?ref=MR%2FZ503915%2F1)].