Skip to content

Commit 5affc17

Browse files
committed
fix(arrivals): no arrival at time 0 - amended test logic accordingly - re-ran notebooks, which all now have slightly different results.
1 parent 7a1b582 commit 5affc17

23 files changed

+14382
-14383
lines changed

notebooks/analysis.ipynb

Lines changed: 377 additions & 379 deletions
Large diffs are not rendered by default.

notebooks/choosing_parameters.ipynb

Lines changed: 625 additions & 625 deletions
Large diffs are not rendered by default.

notebooks/generate_exp_results.ipynb

Lines changed: 119 additions & 119 deletions
Large diffs are not rendered by default.

outputs/choose_param_conf_int_1.png

52 Bytes
Loading

outputs/choose_param_conf_int_2.png

-4.72 KB
Loading

outputs/choose_param_conf_int_3.png

-117 Bytes
Loading
-5.85 KB
Loading
-3.69 KB
Loading

outputs/example_interval_audit.csv

Lines changed: 11160 additions & 11160 deletions
Large diffs are not rendered by default.

outputs/example_overall.csv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
arrivals,mean_q_time_nurse,mean_time_with_nurse,mean_nurse_utilisation,mean_nurse_utilisation_tw,mean_nurse_q_length
2-
10776.741935483871,0.499036905566402,9.978456743390534,0.49767035119563796,0.49780403428685593,0.12459850290556283
3-
115.80327218806197,0.06739346957542013,0.11513823236530764,0.007524465631261531,0.007540589145270748,0.017212719807337778
4-
10734.264952313013,0.47431678135150124,9.936223698796068,0.4949103549196282,0.4950381238581605,0.11828482630760263
5-
10819.21891865473,0.5237570297813028,10.020689787985,0.5004303474716477,0.5005699447155514,0.13091217950352302
2+
10776.741935483871,0.5016901310828316,9.9785879812698,0.49768010202939217,0.497800680610181,0.12525116811287498
3+
115.80327218806197,0.06742190929332627,0.11502904359180056,0.007507558993998087,0.007544462802101291,0.017211501482469225
4+
10734.264952313013,0.4769595750951833,9.936394987440801,0.49492630715799685,0.4950333493126889,0.11893793840008443
5+
10819.21891865473,0.5264206870704798,10.0207809750988,0.5004338969007874,0.5005680119076731,0.13156439782566554

outputs/example_run.csv

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
run_number,scenario,arrivals,mean_q_time_nurse,mean_time_with_nurse,mean_nurse_utilisation,mean_nurse_utilisation_tw,mean_nurse_q_length
2-
0,0,10972,0.504541081338615,9.84226781662332,0.4996386466177992,0.49974045251278504,0.12814409130665008
3-
1,0,10784,0.514150649003393,10.060480983450425,0.5019905433327594,0.5020690100987935,0.1283472360845507
4-
2,0,10854,0.5232349226016817,9.925024519746302,0.4981297032213408,0.49826045142699366,0.1326692082859329
5-
3,0,10831,0.4791488631810612,9.9370571543943,0.49822049332297624,0.49826895028941315,0.12013104947023319
6-
4,0,10720,0.46145745726579823,10.015904147971671,0.4968703372055205,0.4971055007588991,0.11450981346966105
7-
5,0,10772,0.3882646868128185,9.884995942861282,0.492904233058074,0.4930559758823056,0.09681451866545558
8-
6,0,10831,0.4669381081669874,10.041799654744745,0.503356251584998,0.5034005361957363,0.11706959836936667
9-
7,0,10781,0.625888360901447,10.086979128063648,0.5034489381047406,0.5037422085180931,0.15619681525181714
10-
8,0,10772,0.4684971326393017,10.202270228377186,0.508790994907774,0.5089130015618397,0.11682062761089254
11-
9,0,10705,0.5634349862001105,10.09260227901333,0.49997178325917613,0.5002278075946733,0.1399966447950717
12-
10,0,10927,0.562585969190057,10.083553615426284,0.5098373896503802,0.5099889270180521,0.14230039086434612
13-
11,0,10688,0.39781182403365434,9.893334037740962,0.4895233535105571,0.489627107280519,0.09842159202017818
14-
12,0,11092,0.44530362984867583,9.810905063859671,0.5034276977164731,0.503459064398387,0.11437196007956935
15-
13,0,10640,0.4397605749351992,9.933879963761742,0.48925457544062534,0.48926772880832675,0.10831140086366944
16-
14,0,10904,0.6107822771635987,10.167683587926042,0.513130373051619,0.5135294499218969,0.1541659710692565
17-
15,0,10849,0.47670998312351787,9.975581276412813,0.5009629889699926,0.5010455334069701,0.11971820849321864
18-
16,0,10719,0.428336230071242,9.809804967118032,0.4866947365248423,0.48682744992243954,0.10628092708642692
19-
17,0,10713,0.505574486075843,9.989154604862323,0.4954087210793937,0.4957697619501464,0.1253754506789469
20-
18,0,10568,0.3615821082986753,9.800182515281657,0.4793715775153063,0.4795652084277076,0.08845369723380557
21-
19,0,10707,0.4191589720392036,9.9193906381964,0.4915291568180775,0.49176351271863106,0.10388738688943873
22-
20,0,10845,0.6120142008002236,9.813774247048583,0.49261944375555833,0.4926720149388125,0.15364106499255614
23-
21,0,10726,0.5173212645251098,9.858186468091487,0.48940978932654106,0.4895612849605331,0.1284441639651928
24-
22,0,10618,0.5316566599495316,9.969891296475984,0.4892835610032433,0.4893719186906069,0.13067431517000294
25-
23,0,10914,0.5270546197660896,9.925291785145637,0.5013818263178943,0.5014338001561723,0.1331544935214607
26-
24,0,10660,0.5029697553047842,9.96454608027881,0.49160360886911897,0.49162164437257705,0.12411244424881943
27-
25,0,10685,0.6270646900660448,10.236338445072258,0.5060501169430693,0.5061407672693301,0.15515572552368928
28-
26,0,10806,0.5061794260886525,10.039653295082593,0.5022615440123254,0.5023039700989324,0.126615159220231
29-
27,0,10748,0.4925537687951073,10.050997027592315,0.4999546777219452,0.5001183558252174,0.12254555340300495
30-
28,0,10589,0.4577189216542841,10.044180668559221,0.4923573694687436,0.49236726450892265,0.11219411253234293
31-
29,0,10863,0.5422405738480466,10.034383892923174,0.5046064549261675,0.5047331518468752,0.13635091096554006
32-
30,0,10796,0.5102078888697092,9.922063713004379,0.49578999982774674,0.49597325153194544,0.12767905794112022
2+
0,0,10972,0.501873288433248,9.842379990825465,0.49958878609667684,0.499687873737888,0.1274665213122592
3+
1,0,10784,0.5162638608821064,10.060423560536304,0.5019774882864758,0.5020392568872607,0.12887475638316287
4+
2,0,10854,0.5312797210924174,9.925089673744292,0.49809386117421955,0.49825100523985744,0.13468878790704467
5+
3,0,10831,0.4911035979224117,9.938503720153147,0.4982487932220592,0.4982487932220586,0.12312831178466763
6+
4,0,10720,0.4632522371350816,10.016611116790997,0.49693389991134934,0.49717563276665433,0.1149551847705573
7+
5,0,10772,0.3904951453981618,9.883800932020227,0.4928539383795759,0.49300735898657805,0.0973706876441898
8+
6,0,10831,0.4732773513358222,10.040555259165185,0.5033858255951804,0.503385825595184,0.11865895815551598
9+
7,0,10781,0.611501683470203,10.086612424440187,0.5034113289416777,0.5037443245275464,0.15260647336787636
10+
8,0,10772,0.47892602400167145,10.202806309000646,0.5088177294470143,0.5089730393154471,0.11942109098486121
11+
9,0,10705,0.5647473631653535,10.093238146039786,0.49994369431171704,0.5002588194992369,0.14015943381168444
12+
10,0,10927,0.5710886426068235,10.082693576415949,0.5097942141014932,0.5099498928998576,0.14445105550381387
13+
11,0,10688,0.39338731144465283,9.895606898184578,0.48962260282436343,0.4896328732403764,0.09732693483149188
14+
12,0,11092,0.44440250011421983,9.808885513355504,0.5033978686932535,0.5034505365559263,0.1141406492549077
15+
13,0,10640,0.44764948026318635,9.932816012126937,0.4892236002933267,0.48924192080486717,0.11025440902778479
16+
14,0,10904,0.6148477335265125,10.165898811805276,0.5131047752810153,0.5135322352466768,0.1551921223697475
17+
15,0,10849,0.46151166088825735,9.97527206509048,0.5009476110379539,0.5010361213888737,0.11590138909668296
18+
16,0,10719,0.4257522707631643,9.80931192832356,0.48669127709236415,0.48680380067349555,0.10563978218311014
19+
17,0,10713,0.4811166622747489,9.988073964553942,0.4953608235769949,0.49581846931400536,0.1193102500682728
20+
18,0,10568,0.37614947541125254,9.801716381189982,0.4794301592441245,0.47954677755182856,0.09201730685523418
21+
19,0,10707,0.42907788720455214,9.92338975169577,0.4916972800926532,0.49174375431682055,0.10634576246062824
22+
20,0,10845,0.6245182330573088,9.813121481621002,0.4926570184731424,0.4927532298481572,0.15678009809042856
23+
21,0,10726,0.5152436681690306,9.861201095110324,0.4895340968911088,0.4895372933604176,0.1279283237217829
24+
22,0,10618,0.5252369665044344,9.971738394928153,0.4893427907640909,0.4893466756619449,0.1290964377394464
25+
23,0,10914,0.5204269703372153,9.923495967713496,0.5013717929835146,0.5014248673491548,0.1314800915338048
26+
24,0,10660,0.5196503817355377,9.963032663479305,0.4915750702731453,0.49163070655567437,0.1282285432708526
27+
25,0,10685,0.6386328892399044,10.236576381308916,0.5060739795771849,0.5061403611532679,0.15801671256011324
28+
26,0,10806,0.514672047994919,10.040644164410518,0.5023111150028697,0.5023111150028707,0.1287394942276179
29+
27,0,10748,0.5032874412345651,10.052037201655754,0.4999763333861762,0.5001010382032167,0.12521605135159966
30+
28,0,10589,0.4616356744718863,10.043531523096945,0.49232621417270916,0.4923446753095793,0.11315417030052786
31+
29,0,10863,0.5515493444111204,10.035942383790465,0.5046625973715585,0.5047271337062049,0.138691678896713
32+
30,0,10796,0.50983654907801,9.921220126790663,0.4957265964121678,0.4959756909946821,0.12754474203274405

outputs/scenario_nurse_util.png

80 Bytes
Loading

outputs/scenario_nurse_wait.png

-436 Bytes
Loading

outputs/sensitivity_consult_time.png

-462 Bytes
Loading

outputs/sensitivity_consult_time.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
& Mean nurse consultation time & Mean wait time for nurse (95 percent confidence interval) \\
44
\midrule
55
0 & 8 & 0.15 (0.14, 0.16) \\
6-
1 & 9 & 0.28 (0.27, 0.30) \\
7-
2 & 10 & 0.50 (0.47, 0.52) \\
6+
1 & 9 & 0.29 (0.27, 0.30) \\
7+
2 & 10 & 0.50 (0.48, 0.53) \\
88
3 & 11 & 0.84 (0.80, 0.88) \\
9-
4 & 12 & 1.36 (1.29, 1.42) \\
10-
5 & 13 & 2.15 (2.05, 2.24) \\
11-
6 & 14 & 3.37 (3.22, 3.52) \\
12-
7 & 15 & 5.30 (5.06, 5.54) \\
9+
4 & 12 & 1.36 (1.30, 1.42) \\
10+
5 & 13 & 2.16 (2.06, 2.25) \\
11+
6 & 14 & 3.39 (3.24, 3.54) \\
12+
7 & 15 & 5.32 (5.09, 5.56) \\
1313
\bottomrule
1414
\end{tabular}

outputs/spread_nurse_time.png

-425 Bytes
Loading

outputs/spread_nurse_wait.png

-128 Bytes
Loading

simulation/model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ def generate_patient_arrivals(self):
451451
Generate patient arrivals.
452452
"""
453453
while True:
454+
# Sample and pass time to arrival
455+
sampled_inter = self.patient_inter_arrival_dist.sample()
456+
yield self.env.timeout(sampled_inter)
457+
454458
# Create new patient, with ID based on length of patient list + 1
455459
p = Patient(len(self.patients) + 1)
456460
p.arrival_time = self.env.now
@@ -468,10 +472,6 @@ def generate_patient_arrivals(self):
468472
# Start process of attending clinic
469473
self.env.process(self.attend_clinic(p))
470474

471-
# Sample and pass time to next arrival
472-
sampled_inter = self.patient_inter_arrival_dist.sample()
473-
yield self.env.timeout(sampled_inter)
474-
475475
def attend_clinic(self, patient):
476476
"""
477477
Simulates the patient's journey through the clinic.

0 commit comments

Comments
 (0)