Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Dates formatted as YYYY-MM-DD as per [ISO standard](https://www.iso.org/iso-8601-date-and-time-format.html).

## v0.6.0 - 2026-09-07

Various changes including new conceptual modelling page and new section on factorial sensitivity analysis. Also additional MCQ, some fixes to environment and code, and other changes and additions to pages.

### Added

* Add conceptual modelling page (#200).
* Add factorial sensitivity analysis (#211).
* Add MCQ to pages otherwise missing them (#145).

### Fixed

* Environment fixes (curl, rlang, R pinned, upgrade lintquarto).
* Correct some commands on environment page (#208).
* Add `patient_id_counter` to all Python code (#209).

### Changed

* Hid Python/R buttons on impact page.
* Add renal capacity model and quotes from Lucy and Dan to index and impact page (#199).
* Mention TRACE and execution tracing (#196) on verification and validation page.
* Add delete instructions (#198) to environment page.
* Add link to STARS Quarto workshop on documentation page (#194).
* Add paper citation and ARC funding and logos.
* Add rig Pop OS instructions to environment page.

## v0.5.0 - 2026-02-20

This release has lots and lots of changes based on peer review of the book from Nav Mustafee, Rob Challen, Tom Slater and Alison Harper. Other changes include addressing FAIRness requirements, switching R length of warm-up analysis to use intervals, and improving the docker action used to build the site.
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ keywords:
- simmer
- rap
license: MIT
version: '0.5.0'
date-released: '2026-02-20'
version: '0.6.0'
date-released: '2026-09-07'
17 changes: 14 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ renv::init()
renv::restore()
```

> On Linux, some system dependencies are required for all packages to install successfully.
>
> ```
> sudo apt install libfontconfig1-dev libharfbuzz-dev libfribidi-dev
> ```

**3. Create the book.**

```
quarto render
quarto preview
```

### Common `reticulate` error and solution

When rendering a Quarto document containing executable Python code with `reticulate`, configuration errors can occur if R is not using the same Python as your conda/mamba environment.
**However,** the first time you try to run it, you will likely run into a `reticulate` error. When rendering a Quarto document containing executable Python code with `reticulate`, configuration errors can occur if R is not using the same Python as your conda/mamba environment.

Whilst you can use `reticulate::use_condaenv()` on each page, this caused errors for our GitHub action - and anyway, a more robust approach is to configure which Python interpreter reticulate should use.

Expand All @@ -45,6 +50,12 @@ RETICULATE_PYTHON=/home/amy/mambaforge/envs/des-rap-book/bin/python
RETICULATE_CONDA=/home/amy/mambaforge/bin/conda
```

If using Pop!_OS, you will also need to a line to similar to this (but with appropriate version). This is to allow `pak::pkg_sysreqs("plotly")` to run on `environment.qmd`.

```
PKG_SYSREQS_PLATFORM=ubuntu-24.04
```

<br>

## Linting
Expand Down
36 changes: 36 additions & 0 deletions pages/guide/experiments/scenarios.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,42 @@ In practice, sensitivity analysis is often performed within each scenario - for

:::

### Two-way and factorial sensitivity analysis

The previous example varied one parameter at a time. However, model outputs can depend on several uncertain parameters at once. Varying two or more parameters together can show:

* The **main effect** of each parameter: its average effect on the outcome across the values of other parameters.
* An **interaction effect**: whether the effect of one parameter changes depending on the value of another parameter.

One way to investigate this is to use a 2k factorial design, as described in @Robinson2007. For each parameter (called a "factor"), you choose a plausible low (`-`) and high (`+`) value, then run the model for every possible combination of these values. For example:

| Factor 1 | Factor 2 | Factor 3 | Response |
| - | - | - | - |
| - | - | - | $R_1$ |
| + | - | - | $R_2$ |
| - | + | - | $R_3$ |
| + | + | - | $R_4$ |
| - | - | + | $R_5$ |
| + | - | + | $R_6$ |
| - | + | + | $R_7$ |
| + | + | + | $R_8$ |

The main effect of Factor 1 is the average change in the response when Factor 1 changes from its low to high value, across all combinations of Factors 2 and 3:

$$
\frac{
(R_2 - R_1) + (R_4 - R_3) + (R_6 - R_5) + (R_8 - R_7)
}{4}
$$

For example, a main effect of `+2` minutes for mean waiting time would indicate that changing Factor 1 from its low to high value increases mean waiting time by 2 minutes *on average* across the tested combinations of the other factors.

An interaction occurs when the effect of one factor is different at different values of another factor. For example, increasing the number of doctors may reduce waiting time substantially when demand is high, but have little effect when demand is low. In that case, the effect of the number of doctors depends on the arrival rate: the two factors interact. See @Robinson2007 for the formula for calculating interaction effects.

For an applied healthcare example, please see Monks, T., Pearson, M., Pitt, M., Stein, K., & James, M. A. (2015). *Evaluating the impact of a simulation study in emergency stroke care*. Operations research for health care, 6, 40-49. <https://doi.org/10.1016/j.orhc.2015.09.002>. They used a 2k factorial design to explore uncertainty in an emergency stroke care simulation:

> "Here we focus on the uncertainty in the model results. To illustrate the results of the model we include a 23 factorial design including two of the early referral parameters and the proportion of exclusions between midnight and 11 am (due to our concern about underestimating the proportion of 'wake-up' strokes where the onset time is unknown). Full results, main and interaction effects are provided in the online supplementary material (see Appendix A)."

## Saving results

Saving your simulation results to file is important for reproducility, as it allows others to verify your findings and generate consistent (or new) figures and analyses, even if they can't re-run your simulation.
Expand Down
10 changes: 10 additions & 0 deletions pages/guide/experiments/scenarios_resources/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ @article{Heather2025
URL = {https://doi.org/10.1080/17477778.2025.2552177},
eprint = {https://doi.org/10.1080/17477778.2025.2552177}
}

@incollection{Robinson2007,
author = {Stewart Robinson},
title = {Chapter 10: Experimentation: Searching the Solution Space},
booktitle = {Simulation: The Practice of Model Development and Use},
publisher = {John Wiley \& Sons},
year = {2007},
pages = {167-199},
isbn = {9780470847725}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
scenario,interarrival_time,number_of_doctors,mean,std_dev,ci_lower,ci_upper,metric
0,4,3,4.85916630025862,3.18294609944992,0.9070167203485484,8.811315880168692,mean_patients_in_system
1,4,4,4.077251640043243,2.597156294023534,0.8524561720459047,7.302047108040581,mean_patients_in_system
2,4,5,3.687066782754907,2.0455534676890834,1.1471766855245007,6.2269568799853126,mean_patients_in_system
3,5,3,3.3492346438019935,2.2862909049990146,0.5104295376440096,6.1880397499599775,mean_patients_in_system
4,5,4,2.923448380538627,1.9557821828895496,0.4950240557162986,5.351872705360956,mean_patients_in_system
5,5,5,2.813891400386683,1.7906419268135232,0.5905157861881074,5.037267014585258,mean_patients_in_system
6,6,3,2.6678235002222697,1.5729375813352897,0.7147635340565317,4.620883466388007,mean_patients_in_system
7,6,4,2.4143250992529275,1.352840401927087,0.7345518768645503,4.0940983216413045,mean_patients_in_system
8,6,5,2.35876465367196,1.2873665521823698,0.7602879533354008,3.957241354008519,mean_patients_in_system
9,7,3,2.1873524727756872,1.1410280013058747,0.7705790826117824,3.604125862939592,mean_patients_in_system
10,7,4,2.0719012805919315,1.0179671444453147,0.8079281259798909,3.335874435203972,mean_patients_in_system
11,7,5,2.0511265633273466,0.9942008006338163,0.8166632221949766,3.2855899044597168,mean_patients_in_system
12,8,3,1.6672893427505808,0.7821507049868084,0.6961209711987658,2.6384577143023957,mean_patients_in_system
13,8,4,1.6510501688952215,0.76457756478943,0.7017017328618786,2.6003986049285643,mean_patients_in_system
14,8,5,1.6510501688952215,0.76457756478943,0.7017017328618786,2.6003986049285643,mean_patients_in_system
0,4,3,4.85916630025862,3.18294609944992,0.907016720348556,8.811315880168683,mean_patients_in_system
1,4,4,4.077251640043243,2.597156294023534,0.852456172045911,7.302047108040575,mean_patients_in_system
2,4,5,3.687066782754907,2.0455534676890834,1.1471766855245056,6.226956879985308,mean_patients_in_system
3,5,3,3.3492346438019935,2.2862909049990146,0.5104295376440149,6.188039749959972,mean_patients_in_system
4,5,4,2.923448380538627,1.9557821828895496,0.49502405571630304,5.35187270536095,mean_patients_in_system
5,5,5,2.813891400386683,1.7906419268135232,0.5905157861881118,5.037267014585254,mean_patients_in_system
6,6,3,2.6678235002222697,1.5729375813352897,0.7147635340565355,4.620883466388004,mean_patients_in_system
7,6,4,2.4143250992529275,1.352840401927087,0.7345518768645536,4.094098321641301,mean_patients_in_system
8,6,5,2.35876465367196,1.2873665521823698,0.7602879533354039,3.957241354008516,mean_patients_in_system
9,7,3,2.1873524727756872,1.1410280013058747,0.7705790826117853,3.604125862939589,mean_patients_in_system
10,7,4,2.0719012805919315,1.0179671444453147,0.8079281259798934,3.3358744352039693,mean_patients_in_system
11,7,5,2.0511265633273466,0.9942008006338163,0.8166632221949788,3.285589904459714,mean_patients_in_system
12,8,3,1.6672893427505808,0.7821507049868084,0.6961209711987676,2.638457714302394,mean_patients_in_system
13,8,4,1.6510501688952215,0.76457756478943,0.7017017328618805,2.6003986049285626,mean_patients_in_system
14,8,5,1.6510501688952215,0.76457756478943,0.7017017328618805,2.6003986049285626,mean_patients_in_system
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
scenario,interarrival_time,number_of_doctors,mean,std_dev,ci_lower,ci_upper,metric
0,4,3,2.282464866558232,2.8873314231037424,-1.3026306123921314,5.867560345508595,mean_queue_length
1,4,4,1.1097318320073017,1.9535470974076883,-1.3159172676392914,3.535380931653895,mean_queue_length
2,4,5,0.5213509146700799,1.0360671913009343,-0.7650964164883847,1.8077982458285444,mean_queue_length
3,5,3,1.1650943593485281,1.7577071663684805,-1.0173873485159723,3.3475760672130286,mean_queue_length
4,5,4,0.5413844275221968,1.1160339914943753,-0.8443548004880175,1.9271236555324112,mean_queue_length
5,5,5,0.2820443207617665,0.6306702738910651,-0.5010362530660779,1.0651248945896108,mean_queue_length
6,6,3,0.6622472944073305,0.9683635787740693,-0.5401348985281882,1.8646294873428493,mean_queue_length
7,6,4,0.27837536887873654,0.5670352204788746,-0.4256918501034171,0.9824425878608902,mean_queue_length
8,6,5,0.13251703348173421,0.29631709504177334,-0.23540923548395953,0.500443302447428,mean_queue_length
9,7,3,0.34511051247742225,0.5142664784669511,-0.29343565931802335,0.9836566842728678,mean_queue_length
10,7,4,0.11563639266878852,0.24324737602325713,-0.18639511679682397,0.41766790213440097,mean_queue_length
11,7,5,0.046407885898241616,0.10377118756052216,-0.0824410617465093,0.17525683354299254,mean_queue_length
12,8,3,0.06172115012483844,0.11425351337849031,-0.08014332410552535,0.20358562435520225,mean_queue_length
13,8,4,0.0038485910389422,0.008605711180671298,-0.006836810713036979,0.01453399279092138,mean_queue_length
14,8,5,0.00103860065059186,0.0023223816561989065,-0.001845017041999159,0.00392221834318288,mean_queue_length
0,4,3,2.282464866558232,2.8873314231037424,-1.3026306123921247,5.867560345508588,mean_queue_length
1,4,4,1.1097318320073017,1.9535470974076883,-1.315917267639287,3.5353809316538904,mean_queue_length
2,4,5,0.5213509146700799,1.0360671913009343,-0.7650964164883822,1.807798245828542,mean_queue_length
3,5,3,1.1650943593485281,1.7577071663684805,-1.017387348515968,3.347576067213024,mean_queue_length
4,5,4,0.5413844275221968,1.1160339914943753,-0.8443548004880148,1.9271236555324085,mean_queue_length
5,5,5,0.2820443207617665,0.6306702738910651,-0.5010362530660764,1.0651248945896092,mean_queue_length
6,6,3,0.6622472944073305,0.9683635787740693,-0.540134898528186,1.864629487342847,mean_queue_length
7,6,4,0.27837536887873654,0.5670352204788746,-0.42569185010341576,0.9824425878608889,mean_queue_length
8,6,5,0.13251703348173421,0.29631709504177334,-0.23540923548395887,0.5004433024474273,mean_queue_length
9,7,3,0.34511051247742225,0.5142664784669511,-0.2934356593180221,0.9836566842728667,mean_queue_length
10,7,4,0.11563639266878852,0.24324737602325713,-0.18639511679682336,0.41766790213440036,mean_queue_length
11,7,5,0.046407885898241616,0.10377118756052216,-0.08244106174650905,0.17525683354299226,mean_queue_length
12,8,3,0.06172115012483844,0.11425351337849031,-0.08014332410552508,0.20358562435520197,mean_queue_length
13,8,4,0.0038485910389422,0.008605711180671298,-0.006836810713036958,0.014533992790921359,mean_queue_length
14,8,5,0.00103860065059186,0.0023223816561989065,-0.0018450170419991537,0.003922218343182874,mean_queue_length
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
scenario,interarrival_time,number_of_doctors,mean,std_dev,ci_lower,ci_upper,metric
0,4,3,13.262889237569237,7.809683711982843,3.5658861350417883,22.959892340096687,mean_time_in_system
1,4,4,10.575369844380475,6.247718291827938,2.817802970498592,18.33293671826236,mean_time_in_system
2,4,5,8.730675857404929,4.182349267541185,3.537603343985147,13.923748370824711,mean_time_in_system
3,5,3,11.23532646310502,5.451946192617937,4.4658411555872295,18.00481177062281,mean_time_in_system
4,5,4,9.01582567934349,4.398222201919676,3.5547115151193305,14.47693984356765,mean_time_in_system
5,5,5,8.614731276273536,4.03833544514373,3.600475541368386,13.628987011178687,mean_time_in_system
6,6,3,9.451101268771557,4.692782792453591,3.6242418239917953,15.27796071355132,mean_time_in_system
7,6,4,8.326716249263633,3.9516393065569413,3.4201079884249816,13.233324510102285,mean_time_in_system
8,6,5,8.110967542266511,3.912119319390652,3.2534298267017165,12.968505257831307,mean_time_in_system
9,7,3,9.864700764356396,3.7955234836199336,5.151935900408581,14.57746562830421,mean_time_in_system
10,7,4,9.156236964518444,3.3242613444646794,5.0286213324762015,13.283852596560685,mean_time_in_system
11,7,5,9.044029062870168,3.3190018002957715,4.922944017469422,13.165114108270913,mean_time_in_system
12,8,3,11.037798145446914,8.835548401835315,0.06701579050117701,22.00858050039265,mean_time_in_system
13,8,4,10.907884754604039,8.924232487987485,-0.17301343733044838,21.988782946538528,mean_time_in_system
14,8,5,10.907884754604039,8.924232487987485,-0.17301343733044838,21.988782946538528,mean_time_in_system
0,4,3,13.262889237569237,7.809683711982843,3.565886135041806,22.959892340096665,mean_time_in_system
1,4,4,10.575369844380475,6.247718291827938,2.817802970498607,18.332936718262342,mean_time_in_system
2,4,5,8.730675857404929,4.182349267541185,3.5376033439851566,13.9237483708247,mean_time_in_system
3,5,3,11.23532646310502,5.451946192617937,4.465841155587243,18.004811770622798,mean_time_in_system
4,5,4,9.01582567934349,4.398222201919676,3.554711515119341,14.476939843567639,mean_time_in_system
5,5,5,8.614731276273536,4.03833544514373,3.6004755413683958,13.628987011178676,mean_time_in_system
6,6,3,9.451101268771557,4.692782792453591,3.624241823991806,15.277960713551309,mean_time_in_system
7,6,4,8.326716249263633,3.9516393065569413,3.4201079884249914,13.233324510102275,mean_time_in_system
8,6,5,8.110967542266511,3.912119319390652,3.2534298267017263,12.968505257831296,mean_time_in_system
9,7,3,9.864700764356396,3.7955234836199336,5.15193590040859,14.577465628304202,mean_time_in_system
10,7,4,9.156236964518444,3.3242613444646794,5.0286213324762095,13.283852596560678,mean_time_in_system
11,7,5,9.044029062870168,3.3190018002957715,4.92294401746943,13.165114108270906,mean_time_in_system
12,8,3,11.037798145446914,8.835548401835315,0.06701579050119832,22.00858050039263,mean_time_in_system
13,8,4,10.907884754604039,8.924232487987485,-0.17301343733042707,21.988782946538507,mean_time_in_system
14,8,5,10.907884754604039,8.924232487987485,-0.17301343733042707,21.988782946538507,mean_time_in_system
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
scenario,interarrival_time,number_of_doctors,mean,std_dev,ci_lower,ci_upper,metric
0,4,3,0.8589004779001291,0.1742654826468947,0.6425213019678768,1.0752796538323814,mean_utilisation_tw
1,4,4,0.7418799520089852,0.21601137002819626,0.47366641064230175,1.0100934933756687,mean_utilisation_tw
2,4,5,0.6331431736169653,0.22336252337125148,0.3558019697989349,0.9104843774349956,mean_utilisation_tw
3,5,3,0.7280467614844883,0.23282211721993223,0.4389599205469213,1.0171336024220554,mean_utilisation_tw
4,5,4,0.5955159882541076,0.24087867024110227,0.2964256154805339,0.8946063610276812,mean_utilisation_tw
5,5,5,0.5063694159249834,0.24380861669443174,0.20364103412364576,0.8090977977263211,mean_utilisation_tw
6,6,3,0.668525401938313,0.2513879951918314,0.3563859787279944,0.9806648251486316,mean_utilisation_tw
7,6,4,0.5339874325935478,0.22392032420775007,0.25595362755866913,0.8120212376284264,mean_utilisation_tw
8,6,5,0.44524952403804513,0.20870451174404595,0.18610864554276813,0.7043904025333221,mean_utilisation_tw
9,7,3,0.614080653432755,0.2578948983214237,0.2938618428666222,0.9342994639988877,mean_utilisation_tw
10,7,4,0.4890662219807858,0.21556418292237517,0.2214079367438614,0.7567245072177102,mean_utilisation_tw
11,7,5,0.4009437354858211,0.18518738542439148,0.17100322608286925,0.6308842448887729,mean_utilisation_tw
12,8,3,0.5351893975419142,0.24391500845189512,0.23232891292562863,0.8380498821581998,mean_utilisation_tw
13,8,4,0.4118003944640698,0.19015186194845052,0.17569567329126606,0.6479051156368736,mean_utilisation_tw
14,8,5,0.3300023136489259,0.15269972924040467,0.14040055731565246,0.5196040699821993,mean_utilisation_tw
0,4,3,0.8589004779001291,0.1742654826468947,0.6425213019678772,1.075279653832381,mean_utilisation_tw
1,4,4,0.7418799520089852,0.21601137002819626,0.47366641064230225,1.010093493375668,mean_utilisation_tw
2,4,5,0.6331431736169653,0.22336252337125148,0.35580196979893547,0.9104843774349951,mean_utilisation_tw
3,5,3,0.7280467614844883,0.23282211721993223,0.43895992054692184,1.0171336024220548,mean_utilisation_tw
4,5,4,0.5955159882541076,0.24087867024110227,0.2964256154805345,0.8946063610276807,mean_utilisation_tw
5,5,5,0.5063694159249834,0.24380861669443174,0.20364103412364631,0.8090977977263205,mean_utilisation_tw
6,6,3,0.668525401938313,0.2513879951918314,0.356385978727995,0.980664825148631,mean_utilisation_tw
7,6,4,0.5339874325935478,0.22392032420775007,0.2559536275586697,0.8120212376284258,mean_utilisation_tw
8,6,5,0.44524952403804513,0.20870451174404595,0.18610864554276862,0.7043904025333216,mean_utilisation_tw
9,7,3,0.614080653432755,0.2578948983214237,0.2938618428666228,0.9342994639988871,mean_utilisation_tw
10,7,4,0.4890662219807858,0.21556418292237517,0.2214079367438619,0.7567245072177098,mean_utilisation_tw
11,7,5,0.4009437354858211,0.18518738542439148,0.1710032260828697,0.6308842448887725,mean_utilisation_tw
12,8,3,0.5351893975419142,0.24391500845189512,0.23232891292562918,0.8380498821581992,mean_utilisation_tw
13,8,4,0.4118003944640698,0.19015186194845052,0.17569567329126654,0.647905115636873,mean_utilisation_tw
14,8,5,0.3300023136489259,0.15269972924040467,0.14040055731565282,0.519604069982199,mean_utilisation_tw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading