Skip to content

Commit 60a0d6b

Browse files
committed
fix(warmup): typo
1 parent 5820fef commit 60a0d6b

File tree

1 file changed

+23
-101
lines changed

1 file changed

+23
-101
lines changed

content/13_warm_up.ipynb

Lines changed: 23 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"\n",
1010
"## Why do you need a warm-up period?\n",
1111
"\n",
12-
"Typically when you are modelling a non-terminating system, you will need to deal with **initialisation bias**. That is the real system always has work-in-progress (e.g. patients in queues and in service), but the model starts from empty. One way to do this is to split the model's run length into warm-up and data collection periods. We discard all results in the warm-up period.\n",
12+
"Typically when you are modelling a non-terminating system, you will need to deal with **initialisation bias**. That is the real system always has work-in-progress (e.g. patients in queues and in service), but the model starts from empty. One way to deal with this is to split the model's run length into warm-up and data collection periods. We discard all results in the warm-up period.\n",
1313
"\n",
1414
"> In this tutorial we will focus on coding a warm-up period in Python and SimPy rather than analysis to determine its length\n",
1515
"\n",
@@ -37,7 +37,7 @@
3737
},
3838
{
3939
"cell_type": "code",
40-
"execution_count": 1,
40+
"execution_count": null,
4141
"id": "c1cee9f9-8696-4b13-94ff-bee2a2a2e5f8",
4242
"metadata": {},
4343
"outputs": [],
@@ -49,7 +49,7 @@
4949
},
5050
{
5151
"cell_type": "code",
52-
"execution_count": 2,
52+
"execution_count": null,
5353
"id": "ea3d507f-9e6d-4ff0-8b90-f9c63c8a8bdf",
5454
"metadata": {},
5555
"outputs": [],
@@ -71,7 +71,7 @@
7171
},
7272
{
7373
"cell_type": "code",
74-
"execution_count": 3,
74+
"execution_count": null,
7575
"id": "1ecf0429-f03f-4ad2-abb4-46692a74e559",
7676
"metadata": {},
7777
"outputs": [],
@@ -96,7 +96,7 @@
9696
"\n",
9797
"# run variables (units = days)\n",
9898
"WU_PERIOD = 0.0\n",
99-
"RC_PERIOD = 100"
99+
"RC_PERIOD = 100.0"
100100
]
101101
},
102102
{
@@ -109,7 +109,7 @@
109109
},
110110
{
111111
"cell_type": "code",
112-
"execution_count": 4,
112+
"execution_count": null,
113113
"id": "52c9271f-1d05-454d-a199-8768bdf5b6e8",
114114
"metadata": {},
115115
"outputs": [],
@@ -137,7 +137,7 @@
137137
},
138138
{
139139
"cell_type": "code",
140-
"execution_count": 5,
140+
"execution_count": null,
141141
"id": "576ae9b4-b21b-4ed0-9b13-e5898d423173",
142142
"metadata": {},
143143
"outputs": [],
@@ -236,7 +236,7 @@
236236
},
237237
{
238238
"cell_type": "code",
239-
"execution_count": 6,
239+
"execution_count": null,
240240
"id": "dff74a08-37fd-4b18-8bcd-97994f38369a",
241241
"metadata": {},
242242
"outputs": [],
@@ -248,7 +248,7 @@
248248
" Parameters:\n",
249249
" ----------\n",
250250
" warm_up_period: float\n",
251-
" Duration of warm-up period in simultion time units\n",
251+
" Duration of warm-up period in simulation time units\n",
252252
"\n",
253253
" env: simpy.Environment\n",
254254
" The simpy environment\n",
@@ -276,7 +276,7 @@
276276
},
277277
{
278278
"cell_type": "code",
279-
"execution_count": 7,
279+
"execution_count": null,
280280
"id": "911528e1-e4eb-4307-bb26-632faf7769d1",
281281
"metadata": {},
282282
"outputs": [],
@@ -328,7 +328,7 @@
328328
},
329329
{
330330
"cell_type": "code",
331-
"execution_count": 8,
331+
"execution_count": null,
332332
"id": "b3e686ce-5371-4471-a052-b9d43309bc85",
333333
"metadata": {},
334334
"outputs": [],
@@ -371,7 +371,7 @@
371371
},
372372
{
373373
"cell_type": "code",
374-
"execution_count": 9,
374+
"execution_count": null,
375375
"id": "0d0ea6cf-7d95-4d2c-9690-fcdbdae35d84",
376376
"metadata": {},
377377
"outputs": [],
@@ -438,67 +438,28 @@
438438
"id": "c13f5e57-723c-409b-a1ce-cdb831b4e166",
439439
"metadata": {},
440440
"source": [
441-
"## Quick check 1: No warm-up"
441+
"## No warm-up"
442442
]
443443
},
444444
{
445445
"cell_type": "code",
446-
"execution_count": 10,
446+
"execution_count": null,
447447
"id": "caf52390-5455-4fa1-bb22-60b5b91ad8d0",
448448
"metadata": {},
449-
"outputs": [
450-
{
451-
"name": "stdout",
452-
"output_type": "stream",
453-
"text": [
454-
"0.00: 🥵 Warm up complete.\n",
455-
"3.29: Stroke arrival.\n",
456-
"3.29: Patient 1 admitted to acute ward.(waited 0.00 days)\n",
457-
"4.06: Stroke arrival.\n",
458-
"4.06: Patient 2 admitted to acute ward.(waited 0.00 days)\n",
459-
"5.31: Stroke arrival.\n",
460-
"5.31: Patient 3 admitted to acute ward.(waited 0.00 days)\n",
461-
"5.53: Stroke arrival.\n",
462-
"5.53: Patient 4 admitted to acute ward.(waited 0.00 days)\n",
463-
"5.76: Stroke arrival.\n",
464-
"5.76: Patient 5 admitted to acute ward.(waited 0.00 days)\n"
465-
]
466-
},
467-
{
468-
"data": {
469-
"text/plain": [
470-
"{'mean_acute_wait': 0.0}"
471-
]
472-
},
473-
"execution_count": 10,
474-
"metadata": {},
475-
"output_type": "execute_result"
476-
}
477-
],
449+
"outputs": [],
478450
"source": [
479451
"TRACE = True\n",
480452
"experiment = Experiment()\n",
481-
"results = single_run(experiment, rep=0, wu_period=0.0, rc_period=6.0)\n",
453+
"results = single_run(experiment, rep=2, wu_period=10.0, rc_period=6.0)\n",
482454
"results"
483455
]
484456
},
485457
{
486458
"cell_type": "code",
487-
"execution_count": 11,
459+
"execution_count": null,
488460
"id": "ddedb4f1-207d-4295-9ae4-c49b2c7cdcaf",
489461
"metadata": {},
490-
"outputs": [
491-
{
492-
"data": {
493-
"text/plain": [
494-
"{'n_arrivals': 5, 'waiting_acute': [0.0, 0.0, 0.0, 0.0, 0.0]}"
495-
]
496-
},
497-
"execution_count": 11,
498-
"metadata": {},
499-
"output_type": "execute_result"
500-
}
501-
],
462+
"outputs": [],
502463
"source": [
503464
"# check how many patient waiting times recorded.\n",
504465
"experiment.results"
@@ -509,43 +470,15 @@
509470
"id": "660ea2e1-d9c2-4355-876c-43dfd9dab0fe",
510471
"metadata": {},
511472
"source": [
512-
"## Quick check 2: Include a warm-up"
473+
"## Include a warm-up"
513474
]
514475
},
515476
{
516477
"cell_type": "code",
517-
"execution_count": 12,
478+
"execution_count": null,
518479
"id": "72b5284a-1fcb-4126-b663-c0ef0002e4bf",
519480
"metadata": {},
520-
"outputs": [
521-
{
522-
"name": "stdout",
523-
"output_type": "stream",
524-
"text": [
525-
"3.29: Stroke arrival.\n",
526-
"3.29: Patient 1 admitted to acute ward.(waited 0.00 days)\n",
527-
"4.06: Stroke arrival.\n",
528-
"4.06: Patient 2 admitted to acute ward.(waited 0.00 days)\n",
529-
"5.00: 🥵 Warm up complete.\n",
530-
"5.31: Stroke arrival.\n",
531-
"5.31: Patient 3 admitted to acute ward.(waited 0.00 days)\n",
532-
"5.53: Stroke arrival.\n",
533-
"5.53: Patient 4 admitted to acute ward.(waited 0.00 days)\n",
534-
"5.76: Stroke arrival.\n",
535-
"5.76: Patient 5 admitted to acute ward.(waited 0.00 days)\n"
536-
]
537-
},
538-
{
539-
"data": {
540-
"text/plain": [
541-
"{'mean_acute_wait': 0.0}"
542-
]
543-
},
544-
"execution_count": 12,
545-
"metadata": {},
546-
"output_type": "execute_result"
547-
}
548-
],
481+
"outputs": [],
549482
"source": [
550483
"TRACE = True\n",
551484
"experiment = Experiment()\n",
@@ -555,21 +488,10 @@
555488
},
556489
{
557490
"cell_type": "code",
558-
"execution_count": 13,
491+
"execution_count": null,
559492
"id": "7f5e282b-0f41-41df-bdca-f128e7d418c1",
560493
"metadata": {},
561-
"outputs": [
562-
{
563-
"data": {
564-
"text/plain": [
565-
"{'n_arrivals': 3, 'waiting_acute': [0.0, 0.0, 0.0]}"
566-
]
567-
},
568-
"execution_count": 13,
569-
"metadata": {},
570-
"output_type": "execute_result"
571-
}
572-
],
494+
"outputs": [],
573495
"source": [
574496
"# check how many patient waiting times recorded.\n",
575497
"experiment.results"

0 commit comments

Comments
 (0)