Objectives
The objectives of this assignment are: to convert a description of a system into a simula tion model of that system; to implement that simulation in a shared memory concurrent programming language; to use the implemented simulation to explore the behaviour of the system; to gain a better understanding of safety and liveness issues in concurrent systems.
iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520
Background and context
There are two parts to Assignment 1, which is worth 25% of your final mark. This first part of the assignment (ie, this part) deals with programming threads in Java, and is worth 12.5% of your final mark. The second part of the assignment (to be released in a few weeks) deals with modelling in FSP, and is also worth 12.5% of your final mark. Your task is to implement a concurrent simulation of a hospital emergency department.
The system to simulate
An emergency department (ED) is a part of a hospital provides emergency care to patients who need urgent medical attention. A typical (simplified) view of an emergency department is as follows (italicised numbers below correspond to labelled transitions in Figure 1):
Patients
arrive at the
Foyer
of the ED, where they are admitted (
1
). A
Nurse
is allocated
to a Patient and takes them for
Triage
(
2
) where they are examined and the severity of their injury or illness is assessed to determine their treatment pathway. Patients who are assessed as severe
will be taken (by their allocated Nurse) for
Treatment
(
3
) by a
Specialist
.
All other Patients will be returned to the Foyer (
4
), where they will be released from their allocated Nurse and discharged from the ED (6
). Once Patients who are assessed as
severe have been treated by a Specialist, they too will be taken to the Foyer (5
), released, and discharged (6
).
Whenever a Nurse takes a Patient from one location to another (ie, between Foyer, Triage, or Treatment; transitions 2
–
5
in Figure 1) they must be assisted by a number of support staff known as Orderlies
. Note that a Nurse is allocated to a Patient for the entire duration of their stay in the ED (ie, from the time they are admitted to the time they are discharged). However, Orderlies are only required when a Patient is being transferred from one
location to another. Once the Patient enters a location, the Orderlies are released to assist other Nurses/Patients. Orderlies are not
required for admission to the ED or discharge from the ED.
There is only one Specialist, who also has duties elsewhere in the hospital. Therefore, they leave the ED to attend to these other duties after treating each Patient, returning after period of time.
Figure 1: A schematic of the system, showing the flow of admitted Patients to the Foyer (
1
), where they are allocated to a Nurse, from the Foyer to Triage (2
), where they are assessed and either returned to the Foyer (4
) or taken for Treatment (
3
) by a Specialist before being returned to the Foyer (5
). In the Foyer they are released from their Nurse and discharged (6
). The Specialist enters and leaves the Treatment room in between completing duties in other parts of the hospital. For transitions (2
)–(
5
), Patients must be allocated to a Nurse, who is assisted by Orderlies.