Coupled ED + inpatient discrete-event simulation. ED arrivals follow a Poisson process;
after an ED workup period each visit either discharges or is admitted. Admitted patients
board in the ED until an inpatient bed is available. IP discharges concentrate around
a configurable hour (default noon) — each discharged bed enters a turnaround/cleaning
interval before the next boarder can occupy it. Boarder time emerges from the system,
not as a fixed LOS.
Simulation Parameters
ED capacity
Inpatient capacity
Poisson λ
Fraction admitted
Pre-disposition
Mean (log-normal)
0.6 ≈ realistic
0–23 (12 = noon)
Gaussian noise
Min ED dwell post-admit
IP bed cleaning
Wait → leave
168 = 1 wk
Monte Carlo runs
Reproducibility
Live ED Floor — watch beds fill, patients work up, admits become boarders
Sim Time0.0 hr
Day · Hr1 · 00:00
ED Occ0 / 50
Workup0
Boarding0
Waiting0
IP Occ0 / 120
Avg Board— hr
LWBS0
Rep 1 / 30
Emergency Department
Waiting Room
no patients waiting
Inpatient Unit
— LOS ~5d, discharges concentrate near12:00
ED workup (blue)
ED boarder (red) — waiting for IP bed
ED waiting room
IP occupied
IP turnaround / cleaning
Aggregate Statistics — mean across replicates (warmup discarded)
Bed Occupancy Over Time — sample replicate (run #1)
ED workup
Boarders awaiting IP bed
Waiting room overflow
ED capacity
Boarders & Waiting Queue — ensemble mean ± P5–P95 across replicates
Boarders (mean)
Boarders P5–P95
Waiting queue (mean)
Queue P5–P95
Distribution of Peak Metrics — histogram across replicates
Max boarders per replicate
Max queue per replicate
Reading the Output
Boarder time is endogenous: a boarder leaves the ED only when an IP bed clears + completes turnaround. Tighter IP capacity → longer boarder times → backed-up ED → waiting room → LWBS. Noon discharge clustering: IP beds become available in a daily wave around the configured DC hour. Watch the IP grid turn yellow (turnaround) mid-day, then re-fill from boarders. Boarders pile up overnight and clear after noon. IP utilization: admit-rate × arrivals × IP-LOS / IP-beds. With defaults (0.84/hr × 5.5d / 120 = 0.92), IP runs hot — small perturbations cause cascading delays. Effective IP LOS: the entered "IP LOS (days)" is the mean of a log-normal distribution. Individual stays vary around it (default σ=0.6 → ~70% of patients between p15 and p85, with a long upper tail). Rounding each patient's "ready time" forward to the next noon DC adds ~12 hr on top, so effective mean ≈ entered value + 0.5 day. Adjust IP-LOS-days down to ~4.5 if you want true 5d effective LOS.
Model Notes
Coupling: ED bed → ED workup → either discharge (88%) or boarder (12%) → after Transfer Delay (handoff/transport, default 1 hr) → IP bed → IP LOS → discharge → turnaround → IP bed reopens to next ready boarder. Boarders are FIFO; oldest transfer-ready boarder claims the next available IP bed. Transfer Delay: minimum ED dwell time after admit decision, even when an IP bed is already empty. Captures handoff, transport, and bed-board lag. Each admit has avg boarder time ≥ Transfer Delay. Arrival process: homogeneous Poisson (constant λ) — no time-of-day or day-of-week variation. Real EDs peak afternoons / evenings. ED workup: exponential with the entered mean (default 4 hr). Applies to all comers; admit decision happens at end of workup. IP LOS: log-normal with target mean = IP-LOS-days × 24 hr and log-space σ (default 0.6 → CV ≈ 0.66, realistic for hospital data; CV = 1 corresponds to exponential). Each patient's "ready time" is then pushed forward to the next configured DC hour ± Gaussian noise (DC σ). Turnaround (TAT): exponential mean 2 hr by default — captures cleaning, bed-board lag, and patient transport. LWBS: waiting-room patients leave if their wait exceeds the threshold. Reasonable default is 4 hr. Warm start: live IP unit pre-fills to ~80% with random remaining LOS; Monte Carlo discards the first 48 hr as warmup. RNG: mulberry32 seeded PRNG so results are reproducible from the seed input.
⚠ Operations modeling tool. Outputs depend strongly on input assumptions (especially λ and admit-LOS).
Calibrate against your department's actual arrival rates and LOS distributions before using for staffing or capacity decisions.