Skip to content

Commit 9dfcd16

Browse files
committed
feat(init_cond): fixed typos
1 parent 60a0d6b commit 9dfcd16

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

content/14_initial_conditions.ipynb

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,36 @@
55
"id": "0be7dabf-cb34-4faf-abb1-e2c8e735beda",
66
"metadata": {},
77
"source": [
8-
"# Setting initial conditions\n",
8+
"# Setting Initial Conditions\n",
99
"\n",
10+
"An alternative to including a warm-up period in a model is to set initial conditions. In our stroke example this would mean adding patients to beds and if required the admission queue. \n",
1011
"\n",
11-
"**IMPORTANT: There is still an initialisation bias problem:**\n",
12+
"🎓 **Why use Initial-Conditions over a Warm-Up?**\n",
13+
"\n",
14+
"* While warm-up periods are simpler to code, they can also increase how long it takes to run your model. Setting initial conditions is in theory computationally more efficient (no wasted run-time).\n",
15+
"\n",
16+
"* Setting initial-conditions also allows you to test specific starting scenarios, such as \"What happens if the day begins with a full ward?\"\n",
17+
"\n",
18+
"**In general, adding initial conditions is more complex than including a warm-up period.**\n",
19+
"\n",
20+
"Initial conditions could be \n",
21+
"\n",
22+
"1. Fixed i.e. the same number of patients for each replication.\n",
23+
"2. Random i.e. sampled from a discrete distribution specified by a user.\n",
24+
"\n",
25+
"In this notebook we will learn how to add initial conditions to a SimPy model. We will again use the acute stroke pathway model.\n",
26+
"\n",
27+
"## IMPORTANT: There is still an initialisation bias problem\n",
1228
"\n",
1329
"* We load patients into the model before we begin the run. \n",
1430
"* If there are $n$ acute stroke beds then the first $n$ patients loaded into the queue will begin service immediately and have a zero queuing time.\n",
1531
"* This applies if we have one queue in the model or if we have multiple queues and activities: the time in system metrics will be biased for initial condition patients.\n",
1632
"* This is the same problem faced when starting the model from time zero with no patients.\n",
1733
"\n",
1834
"**Some Options:**\n",
19-
"* Include a setting in a process to switch results collection on and off.\n",
20-
"* Code a seperate process for initial conditions that does not include results collection.\n",
21-
"* Mixed initial conditions and (a shorter) warm-up period.\n",
35+
"1. Include a setting in a process to switch results collection on and off.\n",
36+
"2. Code a seperate process for initial conditions that does not include results collection.\n",
37+
"3. Mixed initial conditions and (a shorter) warm-up period.\n",
2238
" * You will need to do some analysis to ensure this is working acceptably.\n",
2339
" * The warm-up pushes patients into service and also resets results collection. (deletes an initial transient)."
2440
]
@@ -83,7 +99,7 @@
8399
"\n",
84100
"# Acute LoS (Lognormal)\n",
85101
"ACUTE_LOS_MEAN = 7.0\n",
86-
"ACUTE_LOC_STD = 1.0\n",
102+
"ACUTE_LOS_STD = 1.0\n",
87103
"\n",
88104
"# initial conditions for acute queue + service \n",
89105
"# if there are 9 beds then 10 = 1 queuing\n",
@@ -129,7 +145,7 @@
129145
"source": [
130146
"def trace(msg):\n",
131147
" \"\"\"\n",
132-
" Turing printing of events on and off.\n",
148+
" Turning printing of events on and off.\n",
133149
"\n",
134150
" Params:\n",
135151
" -------\n",
@@ -166,7 +182,7 @@
166182
" n_streams=N_STREAMS,\n",
167183
" iat_strokes=IAT_STROKES,\n",
168184
" acute_los_mean=ACUTE_LOS_MEAN,\n",
169-
" acute_los_std=ACUTE_LOC_STD,\n",
185+
" acute_los_std=ACUTE_LOS_STD,\n",
170186
" n_acute_beds=N_ACUTE_BEDS,\n",
171187
" init_cond_params=INIT_COND_PARAMS, \n",
172188
" ):\n",
@@ -273,7 +289,7 @@
273289
" Parameters:\n",
274290
" ----------\n",
275291
" warm_up_period: float\n",
276-
" Duration of warm-up period in simultion time units\n",
292+
" Duration of warm-up period in simulation time units\n",
277293
"\n",
278294
" env: simpy.Environment\n",
279295
" The simpy environment\n",
@@ -296,7 +312,7 @@
296312
"\n",
297313
"The key things to recognise are \n",
298314
"\n",
299-
"* We include a optional parameter called `collection_results` that defaults to `True`. We may set this `False` in our functions that setup initial conditions"
315+
"* We include a optional parameter called `collect_results` that defaults to `True`. We may set this `False` in our functions that setup initial conditions"
300316
]
301317
},
302318
{
@@ -402,8 +418,8 @@
402418
" \"\"\"Set up initial conditions with patients already in the acute\n",
403419
" stroke queue\n",
404420
"\n",
405-
" Parmaters:\n",
406-
" ---------\n",
421+
" Parameters:\n",
422+
" -----------\n",
407423
" env: simpy.Environment\n",
408424
" The simpy environment for the simulation\n",
409425
"\n",

0 commit comments

Comments
 (0)