Case file
A seeded simulation of a hospital day from the front door to a ward bed, drawn as an isometric twin. Levers for ED doctors, escalation beds, discharge before noon and a discharge lounge run against the same patients as the baseline, and the twin ranks the best single move for each day. On one day an extra ED doctor saves no 4-hour breaches at all; earlier discharges do. 17 tests. Simulated data.
Problem
When an emergency department (ED) is overwhelmed, the instinct is to add ED staff. Often the real constraint is upstairs: no ward bed is free because most discharges happen late in the afternoon. Patients who have been seen and need a bed wait in the corridor, and the ED fills up behind them. This twin runs a simulated day from the front door, through the ED, to a ward bed and home, and makes the constraint visible. It also shows that the constraint moves from day to day, so the right move on one day is the wrong one on another.

Monday at 12:19, the busiest minute. Ten patients are waiting for a bed and no ward bed is free. Patients are coloured by how long they have been in the ED: purple under 2 hours, amber 2 to 4, red over 4.
Three decisions
One day, seen as it happens. Patients arrive, wait, see a doctor in a cubicle, then go home or wait in the corridor for a bed. Ward beds show as occupied, newly admitted, being cleaned or free. Patients are coloured by how long they have been in the ED: purple under 2 hours, amber 2 to 4, red over 4. Play the day in a minute, or scrub to any minute. Each day opens at its busiest minute.
Levers with fair comparisons. The simulation is seeded, so a scenario sees exactly the same patients as the baseline: the same arrival times, assessment times and admission decisions, and the same readiness for discharge. The levers ask what would happen with more ED doctors, escalation beds, earlier discharges or a discharge lounge. The four headline measures show the scenario against the baseline for that day, so any difference comes from the lever and not from luck.
The best single move. For the levers you have now, the twin runs each possible next move on the same day and ranks them by the share of patients leaving the ED within 4 hours, then by hours spent waiting for a bed. Click one to apply it.

Wednesday. The doctors keep up and the beds do not, so the queue forms in the corridor rather than in the waiting room.
What the three days show
| Day | Within 4 hours | Hours waiting for a bed | Best move | One more ED doctor |
|---|---|---|---|---|
| Monday | 81.5% | 65.3 | One more ED doctor, +8.3 points | +8.3 points, but +3.5 h waiting for a bed |
| Tuesday | 73.5% | 5.5 | One more ED doctor, +26.5 points | Beds were never the problem |
| Wednesday | 92.9% | 45.0 | Discharge before noon, +5.4 points and 28 fewer hours waiting for a bed | +0.0 points and 10.7 more hours waiting for a bed |
Wednesday is the lesson. With the ward full, an extra doctor sees patients faster, so they reach the bed queue sooner and wait there longer. Not one more patient leaves the ED within 4 hours. Moving a third of discharges before noon, opening two escalation beds or opening a discharge lounge each recover the same 5.4 points. On Tuesday the reverse is true: beds are free and the doctors are the constraint. The twin does not have a favourite lever. It reports whichever one the day needs.
The model
Simple, and written down so every assumption can be argued with:
The randomness is seeded (Mulberry32). Each lever changes only what it says it changes, so a comparison is between two runs of the same day.
Tested
17 tests:
Design
Same design system as the clinical projects: white, one purple for interaction, Atkinson Hyperlegible Next bundled with the app. Amber and red mean only time in the ED. The isometric plan is drawn in SVG with no 3D library. People move between places with a short eased transition, which reduced-motion settings turn off. Dim display follows the system or the button.
Not a planning tool
A simulated hospital with simple assumptions, for demonstrating interface design and flow logic. The numbers describe this model, not any real hospital.