Skip to content

Case Study: Capacity Planning for a Hospital Emergency Department ​

Learning Objectives ​

  • Formulate a practical problem as a simulation model
  • Understand how time-of-day patient arrivals influence staffing decisions
  • Determine optimal staffing levels through systematic parameter variation
  • Use the Explorer block to automate a grid search across multiple scenarios

Problem Description ​

A hospital emergency department is open 24 hours a day.

  • Patient arrivals vary strongly by time of day
  • Each doctor attends to one patient at a time
  • Too little staff → long waiting times, dissatisfied patients
  • Too much staff → unnecessary costs

Emergency department staffing: patient arrivals over the day and doctors in the four shifts, waiting time against costEmergency department staffing: patient arrivals over the day and doctors in the four shifts, waiting time against cost

Objective: For each shift, determine the minimum number of doctors such that at least 90% of patients wait no more than 20 minutes.


Data ​

From historical data, the average inter-arrival time μA\mu_A per shift is known:

ShiftTimePatients/hμA\mu_A (min)
Night00–06230
Morning06–12610
Afternoon12–18106
Evening18–24415
  • Mean treatment duration: μB=30\mu_B = 30 minutes, independent of time of day
  • Exponential distribution is assumed for both inter-arrival and service times

Minimum stability capacity cmin⁡=⌈μB/μA⌉c_{\min} = \lceil \mu_B / \mu_A \rceil: Night 2, Morning 4, Afternoon 6, Evening 3. However, stability alone does not guarantee an adequate service level.


Step 1: Single-Shift Base Model (Afternoon) ​

Starting with the peak-load shift (Afternoon, μA=6\mu_A = 6, μB=30\mu_B = 30) at minimum capacity c=6c = 6:

  • Utilization: ρ=μB/(c⋅μA)=30/(6⋅6)=83%\rho = \mu_B / (c \cdot \mu_A) = 30 / (6 \cdot 6) = 83\%
  • The queue exhibits strong fluctuations — typical at high utilization
diagramdiagram

Step 2: Measuring Service Level ​

A Function block checks per patient whether waiting time ≤ 20 minutes (1 = yes, 0 = no). A Statistics block averages across all patients to obtain the service level.

  • 50 replications of 10,000 time units each (plus 500 time units warm-up)
  • Result at c=6c = 6: service level ≈ 69% ± 2% — well below 90%
diagramdiagram

Step 3: Sweep Over Capacity (Afternoon Shift) ​

Incrementally increasing capacity cc yields:

Capacity ccUtilization ρ\rhoService level (Wq≤20W_q \le 20 min)
683%≈ 65%
771%≈ 83%
863%≈ 92%
956%≈ 97%

→ At c=8c = 8 the target service level of ≥ 90% is first met. Two additional doctors beyond the stability minimum are required.


Step 4: Automated Grid Search with Explorer Block ​

The Explorer block automates parameter variation across all 4 shifts × 10 capacity levels = 40 scenarios:

javascript
for (const mu_A of [30, 10, 6, 15]) {
  for (const c of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) {
    M[0] = mu_A;  // set inter-arrival time
    M[1] = c;     // set capacity
    yield;        // start simulation run (one edition)
  }
}

Wiring:

  • Explorer M[0] → RandomExponential mean (μA\mu_A)
  • Explorer M[1] → Perform capacity (cc)
  • Explorer M[0], M[1] → Statistics P[0], P[1] (for logging which shift/capacity)
  • Queue wait → Function (0/1 indicator) → Statistics P[2]

Statistics block settings:

  • 40 editions (4 shifts × 10 capacities)
  • 10 numBatches per edition → confidence interval per edition via batch means
  • 500 time units warmupWidth to exclude the transient phase
  • Total duration 10,500 time units → each batch covers 1,000 time units
diagramdiagram

Results ​

Critical Capacity c* (service level ≥ 90%) ​

ShiftμA\mu_A (min)c∗c^*
Night (μA=30\mu_A = 30)303
Evening (μA=15\mu_A = 15)154
Morning (μA=10\mu_A = 10)105
Afternoon (μA=6\mu_A = 6)67

Observations:

  • The shorter μA\mu_A (more patients per hour), the more capacity is required
  • Confidence intervals are widest at the critical capacities — estimation is most uncertain exactly where the service level crosses the 90% threshold
  • At ≈ 0% or ≈ 100% service level: negligible uncertainty (result is unambiguous)

Staffing Plan ​

The simulation yields the following minimum staffing plan:

ShiftTimeDoctors
Night00–063
Morning06–125
Afternoon12–187
Evening18–244

Total requirement: 3 + 5 + 7 + 4 = 19 doctor-shifts per 24 hours

This plan forms the basis for scheduling. In practice, additional factors apply: breaks, handover times, absences, part-time arrangements, etc.


Extended Model: Emergency Priority with Gamma-Distributed Treatment Times ​

This model extends the base model with:

  • Gamma-distributed treatment times (shape k=2k = 2, scale θ=25\theta = 25, giving mean μB=50\mu_B = 50 min) — more realistic than exponential for medical treatment
  • A separate emergency arrival stream (μN=180\mu_N = 180 min inter-arrival), prioritized via a Select block
  • Priority logic: the Select block routes an emergency patient whenever the emergency queue is non-empty (checked via a Function block on queue1.measureLoad); otherwise a regular patient is served
diagramdiagram

Priority Logic ​

The Select block routes from input 1 (emergency queue) when its selection parameter S=1S = 1, and from input 0 (regular queue) when S=0S = 0. The Function block:

javascript
M[0] = P[0] > 0 ? 1 : 0

reads the current load of the emergency queue (queue1.measureLoad) and outputs 1 whenever at least one emergency patient is waiting, thus overriding regular patients.

Key Differences from the Base Model ​

AspectBase modelExtended model
Treatment time distributionExponential (μ=30\mu = 30)Gamma (k=2k=2, θ=25\theta=25, mean=50)
Arrival streams1 (regular only)2 (regular + emergency)
RoutingDirect queue → performSelect block with priority
Regular inter-arrivalconfigurableμA=15\mu_A = 15 min
Emergency inter-arrival—μN=180\mu_N = 180 min
Capacityconfigurablec=4c = 4

Exercises ​

Exercise 1: Morning Shift ​

Parametrize the model for the Morning shift (μA=10\mu_A = 10, μB=30\mu_B = 30):

  1. Start at minimum capacity c=4c = 4.
  2. Increase cc stepwise until service level ≥ 90%.
  3. Document results in a table analogous to the Afternoon analysis.

Exercise 2: Sensitivity Analysis ​

Using the Afternoon model (μA=6\mu_A = 6, μB=30\mu_B = 30), investigate the effect of:

  1. A stricter quality target: 95% instead of 90% service level
  2. A shorter waiting time threshold: 10 minutes instead of 20 minutes
  3. Mean treatment duration increasing to μB=45\mu_B = 45 minutes

How many additional doctors are needed in each case?

Exercise 3: Two-Stage Process (Triage + Treatment) ​

Extend the model with an upstream triage stage:

  1. Triage (initial assessment): μB=5\mu_B = 5 min, c1=1c_1 = 1
  2. Treatment: μC=30\mu_C = 30 min, c2c_2 = to be determined

Tasks:

  1. Build two Queue–Perform pairs in series.
  2. Determine c2c_2 for the Afternoon shift (μA=6\mu_A = 6) so that service level ≥ 90%.
  3. Measure waiting time before triage and before treatment separately.
  4. Compare with the result without triage — where is the bottleneck?

Exercise 4: Emergency Prioritization ​

Extend the Afternoon model with an emergency entrance using a Select block:

  • Regular patients: μA=6\mu_A = 6 min
  • Emergency patients: μN=60\mu_N = 60 min (less frequent)
  • Emergencies are prioritized (Select block with priority logic)

Tasks:

  1. Build the model with two Arrive–Queue paths merged via a Select block.
  2. Measure service level separately for regular and emergency patients.
  3. How does staffing need change compared to the model without emergencies?
  4. What happens to regular patient service level as the emergency arrival rate increases?