This document describes a real-time simulation tool for modeling patient flow through a single-room healthcare facility. The tool allows the user to input variables like number of rooms, doctors, nurses, treatment times, and patient arrival rate. It then simulates patient flow over a 12-hour period, tracking metrics like wait times and idle times. The document demonstrates how the tool was used to optimize a fictional 4-room facility's ability to handle different patient arrival rates through a series of test runs, adjusting variables to maximize throughput while minimizing wait times. The optimal configuration was found to be 3 doctors, 2 nurses, 25-minute treatment time, and 10-minute room prep time handling 6 patients per hour.
1. For a simple one floorhealthcare facility,the patientflow throughasingle roomwassimplifiedtothe
following:
Figure:X,patientflowthroughasingle room.
Thisservedasa basisforthe creationof a real time simulation whichoutputswaittimesand patient
throughputforspecificinputsdeterminedbythe user.
Process
Afterthe software isinstalledandexecuted,six variableswill have tobe inputbythe user:
1) Rooms:the numberof roomsavailable foruse.
2) Doctors: the numberof physiciansavailable fortreatingpatients.
3) Nurses:the numberof nursesavailableforpreparingroomswhichhave beenused.
4) TreatmentTime:The average time,inminutes,required forthe treatmentof apatient,taking
intoaccount the patientandphysiciantravel time toreachthe room.
5) RoomPreparationTime:The average time,inminutes,requiredforanurse to prepare a used
room,takingintoaccount the nurse’stravel time toreach the room.
6) PatientsperHour:The amountof patientssetto arrive,distributedevenlythroughouteach
hour.
A fewscreenshotsof the interfaceare showninthe appendix alongwiththe codingstructure.
The followingmightoccurduringthe inputprocess:
2. 1) If a non-integeris enteredatanypoint,the userwill be notified andmustre-inputaninteger
value.
2) If the numberof doctorsis greateror lessthanthe numberof rooms,the userwill be notified.
3) If the numberof nursesisgreaterthan the numberof rooms,the userwill be notified.
4) If the treatmenttime inputismore than300 minutes,the userwill be notifiedand mustre-input
a value lessthan300.
5) If treatmenttime ismore than 2 hours,the userwill be notified.
6) If the roompreparationtime inputismore than300 minutes,the userwillbe notifiedand must
re-inputavalue lessthan300
7) If the roompreparationtime ismore than30 minutes,the userwillbe notified.
8) If the patientflowperhourismore than 600, the userwill be notifiedandmustre-inputavalue
lessthan600.
9) Duringthe inputof patientflowper Hour,the userisnotifiedthatpatientsare distributed
evenlythroughouteachhour. Itisalsoshownthat the simulationrunsfora 12 hourday, and
that patientswhose treatmenttime will exceed6pm will notbe admitted.
10) A recapof all inputsisshown, withthe optionof re-inputtingall variables orstartingthe
simulation.
Whenthe “Start Simulation”optionischosen,atimerstartstickingwhere one minute of simulation
time isequivalenttoone real-life hour.Since patientflow isdistributedevenlythroughoutthe hour,if a
flowof six patientsperhourischosen,the firstpatientwill arrive atthe 10th
minute of simulationtime
(10 secondsreal-time),andevery10minutesafter that.If the patient’streatmenttime will exceedthe
12 hour mark (12th
minute real-time),he will notbe admittedandthe flow stops.
A full roomusage cycle can be illustratedbylookingatfigure X above.If a patientarrivesandbotha
doctor and a roomare available the treatmentbegins. Afterthe treatmenttime iscomplete,the patient
leavesthe systemandthe doctorisready to take ina new patient.A nurse wouldthenprepare the
room inorderto make it available forfurtheruse.Afterthe roompreparationtime iscomplete,the
room isreadyto handle a newpatient.
To explainthis full roomusage cycle insimulation terms,considerthe defaultvalue of “patientswaiting”
inthe interface iszero.Everytime apatientarrives,thisvalue isincreasedby“1”.The defaultvaluesof
“Doctors Idle”and“Rooms Available”are the inputsgivenbythe user.Every6 secondsof simulation
time (0.1 secondsreal-time) the simulationchecksif the three aforementionedvariablesare greater
than zero.If theyare,theyare all decreasedby one. Afterthe value of “treatmenttime”insimulation
minuteshaspassed,the value of “patientspassed”and“DoctorsIdle”inthe interface increasesbyone.
If the value of “NursesIdle”ismore thanzero,it will thendecreasebyone.Afterthe value of “room
preparationtime”insimulationminuteshaspassed,the value of “Roomsavailable” and“NursesIdle”
increasesbyone.
3. Restrictions
Due to time and codingskill constraints,a numberof restrictionsare inherenttothe simulation.If these
restrictions were tobe removed,the abilitytogainmore meaningful andinsightfuldatawill increase.
Possible improvementsonthe simulationinclude:
- The abilitytoinputpreciselywheneachpatientarrives,or tochange arrivalsinto some set
distribution(e.g. Poisson/normaldistribution).
- The abilitytopause and change a variable while the simulationisrunning,suchasaddinga
doctor,changingtreatmenttime oraddinga suddenpatientinflux atsome pointduringthe
work day.
- Allowingthe simulationtorunfor a variable setof time insteadof a12 hour workday (12
minutesreal-time).
- Automaticgraphingandplotoutputs,tobe writtenintospreadsheetsoftware suchasMicrosoft
Excel.
- The optionto obtaininstantgraphoutputsinsteadof havingtowaitfor the simulation tofinish
runninginreal time,or at leastthe decrease of the ratioof real-timetosimulation-timesothat
it completes inlessthan12 minutes.
- More variable inputs (suchastool availability,roomusage time),andstandarddeviationfactors
for howlongtreatment androom preparationtimeslast.
- Changingthe code so that time valuesare more accurate than approximate.
- The abilityformore than one nurse to workon the same room, in orderto decrease room
preparationtime.
- Individualizedinsteadof cumulative idle andwaittimes;one foreachdoctor,patient,nurse and
room.
These are some of manypossible improvementsthatcanbe implementedtothe real-timesimulation
tool.
Optimization Example
To showhowthe tool can be usedto optimize a system, itisto be appliedona fictional facilitywhich
contains fouravailable treatmentrooms.
For the firstrun, the followinginputswereset:
Table Y: first run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 3 2 30 10 8
4. The simulationwasrunfor 4 hours (4 minutesreal-time) while manuallytakingdatavaluesbypausing
every5th
of an hour(12 secondsreal-time).Thisdataisshownin table Z inthe appendix,andwasused
to create the two plots shownbelow.
Figure 1: firstrun variable status
Figure 2: firstrun cumulative idletimes
As can be seenfromthe figuresthe numberof available doctorsandroomsdecreasesovertime tozero
and remainsthere,while the cumulativedoctoridle time remainsata setconstantof about31 minutes.
Thisshowsthat all roomsand doctors are occupiedthroughoutmostof the 4 hours.
5. The amount of patientswaitingandcumulativepatientwaittime howeverare onan increase
throughoutmostof the 4 hours. There is no reasontocontinue the full runof the simulationasitis
apparentthat the currentinputscannothandle a flow of 8 patientsperhour.
In addition,there isatleastone nurse waitingthroughoutthe 4hours,while the cumulative nurse idle
time ison the rise.Thisindicatesthe systemhasmore nursesthanrequiredtoprepare the 4 roomsfor
thissetof inputs.
Thisrun succeededinpassing20 patients,with8waitingtheirturnbythe 4th
hour.
In an attemptto maximize patientthroughput,the followinginputswere usedforthe second
run:
Table V: second run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 3 1 25 10 8
The simulationwasonce againrun for4 real-time minutes,while manuallytakingdataevery12 seconds.
Thisdata is shownin table B inthe appendix.
For thisrun,it was assumed5 minuteswere takenoff eachtreatmenttimeaverage inanattemptto
pass more patients.The numberof nurseswasalsodecreasedto1 inlightof the lastrun’sinformation.
Usingthe data intable B to plotthe same graphs yieldsthe followingfigures:
Figure 3 secondrun variable status
6. Figure 4: secondrun cumulative idle times
As can be seenfromthe figures,the amountof available roomsdecreasestozeroandremainsthere.
However,the numberof idle doctorsreaches1multiple timesthroughoutthe 4 hours,indicatingthat1
nurse wasnot enoughto prepare all 4 roomsin time forthissetof inputs.Thiscan be observedin figure
4, as the doctoridle time isrisingwhile the nurse idle timeflatlines.
Thisrun succeededinpassing21 patients,with7waitingtheirturnbythe 4th
hour.
In lightof the secondrun,the numberof nursesavailablewasincreasedbackto2 in orderto
deal withthe decreasedtreatmenttime. Table K summarizesthe inputsusedinthe thirdrun:
Table K: third run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 3 2 25 10 8
Data was collectedinthe same methodasforthe firstand secondruns,and yieldedthe datashownin
table Q inthe appendix.The graphsacquiredfromthistable are shownbelow:
0
50
100
150
200
250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 3.2 3.4 3.6 3.8 4
Time(min)
Time Elapsed (Hour)
Cumulative Patient Wait Time Cumulative Doctor Idle Time Cumulative Nurse Idle Time
7. Figure 5: thirdrun variable status
Figure 6: thirdrun cumulative idletimes
As can be deducedfrom figure 5,the numberof rooms and doctorsavailable decreasedtozeroand
remainedthere forthe mostpart.The amountof nursesidle remainedatone while the amountof
patientswaitingwas rising.
Eventhoughthe cumulative idle timesplotissimilartothe firstrun,decreasingthe treatmenttime by5
minutesallowedfor24 patientstobe passedinsteadof 20, withonly4 awaitingtreatmentinsteadof 8,
by the 4th
hour.
For the fourthrun, the amountof doctorswas increasedby1 to testfor a possible increase in
patientthroughput.The follow table summarizesvariable inputsusedinthe fourthrun:
8. Table W: fourth run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 4 2 25 10 8
The simulationwasruninthe same manneras before,andthe followinggraphswere createdbasedon
table H inthe appendix:
Figure 7 fourthrun variable status
Figure 8 fourthrun cumulative idletimes
9. The fourthrun’s patientoutputwasidentical tothe thirdrun,butit had at least1 idle doctor
throughoutthe 4 hours,withthe cumulative doctoridle timeonaconstant rise.Thisindicatesthatthe
4th
physicianisnotneededforthissetof inputs,anddoesnothingtoaffectpatientoutput.
So far,the simulationhasshownthatforthissetof inputs,the facility isnotable to handle 8patients
perhour withoutthe costlyadditionof aroom or a furtherdecrease intreatmenttime,bothof which
can be impractical.
For the fifthsimulationrun,the numberof doctorswasbroughtback to 3, and the simulation
was runto test the facility’sabilitytohandle 7patientsperhourinsteadof 8. The followingset
of data wasused:
Table L: fifth run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 3 2 25 10 7
Thistime,as nosignificantbackupof patientflow wasobserved,the simulationwasallowedtorunfor
the full 12 hours(12 minutesreal-time),while takingvaluesat12 secondintervals.The valuesobtained
are shownin table J in the appendix.Thisdatawasusedto obtainthe followingfigures:
Figure 9 fifthrunvariable status
10. Figure 10 fifthruncumulative idle times
By observingfigure 9above,itcan be seenthe amountof doctors and roomsdecreasedtozeroand
remainedthere forthe mostpart throughoutthe simulation. The maximumamountof patientsawaiting
treatmentat anygiventime was2.
Eventhoughthe cumulative patientwaittime increasesto501 minutes,all patientswere effectively
passedthroughthe system.Itisworth notingthatthe simulationstoppedthe patientin-flow half way
throughthe final hour(as theirtreatmenttime wouldexceedthe 12th
hour).Bythe 12th
hour,79
patientshave beenpassedwiththe final 2undertreatment.2of the 3 doctors are treatingthe final
patients,while1nurse iscleaninga room. Thiscomesout to 3 outof the 4 roomsare beingoccupied at
the endof the shift.
A sixthsimulationrunwasconductedtotesthow the facilityhandles6patientsperhourwith
the same inputs.The followinginitial datawasused:
Table N: sixth run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 3 2 25 10 6
11. Thisrun was alsoconductedforthe full 12 hours,and the resultsare shownin table E inthe appendix.
These resultswere usedtoplotthe graphsshownbelow:
Figure 11 sixthrunvariable status
Figure 12 fifthruncumulative idle times
As can be observedfrom figure 11,the amountof available roomsandidle doctorsbothcycledbetween
zeroand one,while the amountof idle nursesremainedatone throughoutmostof the simulation.
However,the numberof patientsawaitingtreatmentremainedatzerothroughthe whole duration.
0
1
2
3
4
0 0.8 1.6 2.4 3.2 4 4.8 5.6 6.4 7.2 8 8.8 9.6 10.4 11.2 12
Elapsed Time (Hours)
Rooms Available Doctors Idle Nurses Idle Patients Waiting
0
100
200
300
400
500
600
700
800
0
0.4
0.8
1.4
1.8
2.2
2.6
3
3.4
3.8
4.2
4.6
5
5.4
5.8
6.2
6.6
7
7.4
7.8
8.2
8.6
9
9.4
9.8
10.2
10.6
11
11.4
11.8
Time(min)
Cumulative Patient Wait Time Cumulative Doctor Idle Time Cumulative Nurse Idle Time
12. Both the doctor andnurse idle time isonthe increase,while the patientwaitingtime isnon-existent. At
the 12th
hour, all 69 patientshave beenpassed,andonly1roomwas occupiedbya nurse. It isworth
notingthat the simulationonce againstoppedadmittingpatientshalf waythroughthe final hourdue to
theirtreatmenttime exceedingthe 12th
hour.
The sixthrun indicatesthatthisfacilityisalmostperfectlyoptimizedforhandlingaflow of 6 patientsper
hour,for thissetof inputs.The patientthroughputismaximizedandpatientwaittime isminimized.
A final setof runswere conductedforthe full 12 hours,to testfor extranursesorphysicians.
The seventh runinputstestedfor1 lessdoctorand 1 lessnurse:
Table G: seventh run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 2 1 25 10 6
55 patientswere passed,with12still awaitingtreatment.
The eighthrun inputstestedforonly1lessdoctor:
Table S: seventh run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 2 2 25 10 6
55 patientswere passed,with12still awaitingtreatment.
The ninthand final runinputstestedforonly1 lessnurse:
Table U: seventh run input values
Rooms Doctors Nurses
Treatment Time
(min)
Room Prep Time
(min)
Patients per
Hour
4 3 1 25 10 6
As withthe sixthrun,all 69 patientswere passed.However,the cumulative nurse idle timedecreased
from717 minutes(almostthe full 12hourduration) downto41 minutes, while the cumulative patient
waittime increasedfromzeroto only 7 minutes. 2roomswere occupiedby2 nursesat the endof the
shift.
Thisfinal iterationprovidesaperfectsetof conditionsforthe fictionalfacilityinquestion.
19. Real time simulationcode:
The real time simulationwascreatedusing001 game creator v.1.014.001
http://www.engine001.com
Graphical representationof software initiation(variableinputs):
http://www.engine001.com/script/PtyxFE
Graphical representationof Timerticks(every0.1secondsonce simulationstarts):
http://www.engine001.com/script/xyp9ZR
Textual code of software initiation(variableinputs):
SET Actor("main").NonExistent = 1
:g2
MsgBox.Show("Welcome to the Automated Patient System Simulation.¶Please Input Number of Rooms:T")
MsgBox.Hide
SET Rooms = MsgBox.Input
IF Rooms <= 0
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g2
ELSE
IF Rooms = Math.Multiply(Rooms, 1)
IF Rooms = Math.Round(Rooms, 0)
:g7
MsgBox.Show("Please Input Number of Doctors:T")
MsgBox.Hide
SET Doctors = MsgBox.Input
IF Doctors <= 0
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g7
ELSE
IF Doctors = Math.Multiply(Doctors, 1)
IF Doctors = Math.Round(Doctors, 0)
IF Doctors > Rooms
MsgBox.Show("Number of Doctors greater than number of rooms." & "Q" & "ok" & "Q" & "Re-input number of Doctors")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
:g14
MsgBox.Show("Please Input Number of Nurses:T")
MsgBox.Hide
SET Nurses = MsgBox.Input
IF Nurses <= 0
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g14
ELSE
IF Nurses = Math.Multiply(Nurses, 1)
IF Nurses = Math.Round(Nurses, 0)
IF Nurses > Rooms
MsgBox.Show("Number of Nurses greater than number of rooms." & "Q" & "ok" & "Q" & "Re-input number of
Nurses")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
:g21
MsgBox.Show("Please Input Treatment Time in Minutes¶Note: please include doctor and patient travel time
to room.T")
MsgBox.Hide
SET Treatment_Time = MsgBox.Input
IF Treatment_Time <= 0
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g21
ELSE
IF Treatment_Time = Math.Multiply(Treatment_Time, 1)
IF Treatment_Time = Math.Round(Treatment_Time, 0)
IF Treatment_Time > 300
MsgBox.Show("Treatment time cannot be more than 300 minutes.")
MsgBox.Hide
GOTO g21
ELSE
IF Treatment_Time > 120
MsgBox.Show("Treatment Time is more than 2 hours." & "Q" & "Ok" & "Q" & "Re-input
Treatment Time")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
:g30
MsgBox.Show("Please Input Room Preparation Time in Minutes¶Note: please include
Nurse travel time to room.T")
MsgBox.Hide
SET Room_Prep_Time = MsgBox.Input
IF Room_Prep_Time <= 0
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g30
ELSE
IF Room_Prep_Time = Math.Multiply(Room_Prep_Time, 1)
IF Room_Prep_Time = Math.Round(Room_Prep_Time, 0)
IF Room_Prep_Time > 300
MsgBox.Show("Room Preparation cannot be more than 300
minutes.")
MsgBox.Hide
GOTO g30
ELSE
IF Room_Prep_Time > 30
20. MsgBox.Show("Room Preparation is more than 30 minutes." &
"Q" & "Ok" & "Q" & "Re-input Room Preparation Time")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
:g39
MsgBox.Show("Please Input Patient Arrivals Per
Hour.¶Note: Patient arrivals will be distributed evenly throughout each hour.¶Note: Simulation runs for a 12 hour day.¶Note: Simulation does not admit
patients whose treatment times will exceed 6 pm.T")
MsgBox.Hide
SET PPH = MsgBox.Input
IF PPH <= 0
MsgBox.Show("Input must be a positive integer not
equal to zero.")
MsgBox.Hide
GOTO g39
ELSE
IF PPH = Math.Multiply(PPH, 1)
IF PPH = Math.Round(PPH, 0)
IF PPH > 600
MsgBox.Show("Patient Arrivals per hour
must be 600 or below.")
MsgBox.Hide
GOTO g39
ELSE
IF PPH > Math.Multiply(Rooms, 2)
MsgBox.Show("Patient arrivals per
hour is more than double the number of rooms" & "Q" & "Ok" & "Q" & "Re-input Patient Arrivals per Hour")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
:g48
SET Spawn("|this:1").Delay =
Math.Divide(60000, PPH)
SET Spawn("|this:1").Interval =
Math.Divide(60000, PPH)
SET Spawn("|this:1").Count =
Math.Multiply(PPH, 12)
Interface("start").Show(1, 1,
1)
MsgBox.Show("Variable Input
Complete." & "Q" & "Start Simulation" & "Q" & "Re-input Variables")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
Interface("start").Show(0,
1, 1)
Interface("sim
running").Show(1, 1, 1)
SET Spawn("|this:0").Paused
= 0
SET Spawn("|this:1").Paused
= 0
ELSEIF MsgBox.SelectedNumber =
1
Interface("start").Show(0,
1, 1)
GOTO g2
ENDIF
ELSEIF MsgBox.SelectedNumber = 1
GOTO g39
ENDIF
ELSE
GOTO g48
ENDIF
ENDIF
ELSE
MsgBox.Show("Input must be a positive
integer not equal to zero.")
MsgBox.Hide
GOTO g39
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer
not equal to zero.")
MsgBox.Hide
GOTO g39
ENDIF
ENDIF
ELSEIF MsgBox.SelectedNumber = 1
GOTO g30
ENDIF
ELSE
GOTO g39
ENDIF
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g30
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g30
ENDIF
ENDIF
ELSEIF MsgBox.SelectedNumber = 1
GOTO g21
ENDIF
ELSE
GOTO g30
ENDIF
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g21
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g21
ENDIF
ENDIF
ELSEIF MsgBox.SelectedNumber = 1
GOTO g14
21. ENDIF
ELSE
GOTO g21
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g14
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g14
ENDIF
ENDIF
ELSEIF MsgBox.SelectedNumber = 1
GOTO g7
ENDIF
ELSE
IF Doctors < Rooms
MsgBox.Show("Number of Doctors less than number of rooms." & "Q" & "ok" & "Q" & "Re-input number of Doctors")
MsgBox.Hide
IF MsgBox.SelectedNumber = 0
GOTO g14
ELSEIF MsgBox.SelectedNumber = 1
GOTO g7
ENDIF
ELSE
GOTO g14
ENDIF
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g7
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g7
ENDIF
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g2
ENDIF
ELSE
MsgBox.Show("Input must be a positive integer not equal to zero.")
MsgBox.Hide
GOTO g2
ENDIF
ENDIF
Textual code of Timerticks:
IF Nurses > 0
SET Spawn("|this:4").Paused = 0
:g3
IF Patients > 0
SET Spawn("|this:2").Paused = 0
IF Rooms > 0
IF Doctors > 0
SET Spawn("|this:3").Paused = 0
SET Doctors = Doctors - (1)
SET Patients = Patients - (1)
SET Rooms = Rooms - (1)
IF Patients > 0
SET Spawn("|this:2").Paused = 0
:g13
IF Doctors > 0
SET Spawn("|this:3").Paused = 0
:g15
Pause(Math.Multiply(Treatment_Time, 1000))
SET Patients_Passed = Patients_Passed + (1)
SET Doctors = Doctors + (1)
IF Doctors > 0
SET Spawn("|this:3").Paused = 0
:g20
IF Nurses > 0
SET Spawn("|this:4").Paused = 0
SET Nurses = Nurses - (1)
IF Nurses > 0
SET Spawn("|this:4").Paused = 0
:g25
Pause(Math.Multiply(Room_Prep_Time, 1000))
SET Rooms = Rooms + (1)
SET Nurses = Nurses + (1)
IF Nurses > 0
SET Spawn("|this:4").Paused = 0
ELSE
SET Spawn("|this:4").Paused = 1
ENDIF
ELSE
SET Spawn("|this:4").Paused = 1
GOTO g25
ENDIF
ELSE
SET Spawn("|this:4").Paused = 1
Pause(100)
GOTO g20
ENDIF
ELSE
SET Spawn("|this:3").Paused = 1
GOTO g20
ENDIF
ELSE
SET Spawn("|this:3").Paused = 1
GOTO g15
ENDIF
ELSE
22. SET Spawn("|this:2").Paused = 1
GOTO g13
ENDIF
ELSE
SET Spawn("|this:3").Paused = 1
ENDIF
ELSE
:g38
IF Doctors > 0
SET Spawn("|this:3").Paused = 0
ELSE
SET Spawn("|this:3").Paused = 1
ENDIF
ENDIF
ELSE
SET Spawn("|this:2").Paused = 1
GOTO g38
ENDIF
ELSE
SET Spawn("|this:4").Paused = 1
GOTO g3
ENDIF
Interface designandidle/waittimercodeswere omitted.