Educational operations model with synthetic data. It is not medical advice and does not describe any real hospital or patient. Each ambulance is one arriving patient; waiting patients form the line in front of the intake tent; occupied beds glow orange.
Self-check: compares the simulator with the closed-form Erlang C result.
The hospital is an M/M/c queue: patients arrive as a Poisson process with rate lambda (patients per hour), treatment times are exponential with mean 1/mu (minutes), there are c identical beds and a single first-come-first-served line. Offered load a = lambda/mu (in Erlangs) and utilisation rho = a/c. The queue is stable only if rho < 1; for rho >= 1 the line grows without bound.
Erlang C: P(wait) = [a^c / (c! (1 - rho))] / [ sum_{k=0}^{c-1} a^k/k! + a^c / (c! (1 - rho)) ]. Mean wait in the line Wq = P(wait) / (c mu - lambda). Little's law L = lambda W relates the mean number in the system to the mean time in the system.
Numerical checks (button above): (1) the Erlang C code must reproduce the M/M/1 closed form Wq = rho / (mu - lambda) at c = 1; (2) a 200,000-patient headless run of the same event engine must match the Erlang C wait and P(wait) within a few percent; (3) Little's law must hold in that run.
Honest simplifications: real arrivals are bursty and time-dependent, treatment times are not exponential, patients differ in acuity (triage priority, preemption and resource types such as surgeons or oxygen are ignored), staffing is constant, and ambulance travel is a fixed 10-minute animation leg that does not affect the queue. Short live runs fluctuate around the theory values; the numbers converge only over many patients. Not medical advice.