Elevator Parking Simulator

July 27, 2026 (2d ago)

Where should idle elevators wait in an apartment? This tick-based simulator holds the passenger scenario fixed (seeded arrivals), then compares parking strategies so only elevator policy changes.

GitHub · Full demo

Demo

Elevator Parking Simulator — fixed scenario compareOpen full screen

Fair comparison

  1. Traffic inputs + scenario seed define one passenger stream
  2. Replay restarts the same stream
  3. Compare all runs every parking strategy headlessly in the browser on that stream
  4. Change seed / New only when you want a different world

Question

Parking means where to send a free car while it waits. With identical arrivals, lobby parking vs stay/spread differences show up cleanly in avg wait and empty travel.

Takeaways

  1. No universal best parking policy — evening favors Lobby/Demand on wait; Stay is cheap on empty travel; morning often wants shaft coverage. Use Batch + Rank-by for this regime.
  2. Parking needs idle timeIdleFrac diagnoses parking-sensitive vs saturated; when saturated, zoning beats smarter parking.
  3. Parking ≠ hall dispatch — sticky can leave IDLE cars unused (#76 on E1 while E3/E4 sit at 20); full reassign is myopic (Mid mean wait worsened on N=100).
  4. Batch N=100 before/after one Policy change. Scope frozen — no further dispatch variants.

Full tree + A/B table: /elevator/INSIGHTS.md · 한국어.

Insight: when parking matters

Parking helps when cars are often idle. IdleFrac ≥25% → parking-sensitive; <10% → saturated. Same seed, raise arrival → Compare-all gaps and IdleFrac often fall.

Sticky vs reassign

Sticky keeps the first car; Reassign rescores each tick.

E1: MOVING  load 4/8   pickup #76 @16→L1
E3: IDLE @ 20
E4: IDLE @ 20

Evening Batch N=100: Stay max wait ~29→24 under reassign; Mid mean wait 4.17→5.02 — empty cars steal work from productive up-trips.

Strategy catalog

There is no single best parking policy. Rankings depend on traffic — the same way airplane boarding methods (WilMA, back-to-front, random) trade off under different constraints.

StrategyIdle placementTypical fit
StayLast floorReactive baseline
LobbyFloor 1Up-peak / ingress
MidMid-buildingCompromise
SpreadEven homes along the shaftDown-peak / egress
DemandRecent call heatAdaptive heuristic

Research directions (deferred): service zoning when saturated, arrival-probability parking, MDP lobby counts — only if the portfolio story needs them.

Batch experiment

In the demo, Batch N (default 100) runs seeds base base+N−1 with the current traffic knobs, every parking strategy headless, then shows mean wait / empty travel / win-rate and a downloadable CSV. Same base seed → deterministic repeat. Use it to see which baseline wins for this regime, not “the” global optimum.

Building view

Out | Floors | Elevators | Hall — alighted passengers on the left, waiting hall calls on the right. Hover dots or cars for trip / panel details. Cars use collective SCAN boarding (finish one direction before reversing).

Traffic model (apartment default)

Passenger OD is generated once from the seed + traffic knobs, then reused for Replay / Compare all.

Traffic period

Controls origin mix (where people appear):

PeriodOrigin mix (approx.)Story
Morning egress~90% upper, ~10% lobbyLeaving the building
Evening ingress~90% lobby, ~10% upperComing home
Midday / off-peak~45% lobby, ~55% upperMixed daytime

Destinations still follow apartment rules below.

Arrival rate

Per-tick probability that one passenger is created (Bernoulli, at most one per tick). Default 15% ≈ an arrival every ~6.7 ticks. Discrete stand-in for Poisson arrivals — denser rate means more concurrent hall calls.

Interfloor trips

If a trip starts on an upper floor, chance the destination is another upper floor instead of the lobby (default 10%). Lobby starts always go upstairs. Low values ≈ pure up/down to lobby; higher values add mid-building stops.

Office any-floor OD is deferred.

Controls

ControlRole
Parking strategyStay / Lobby / Mid / Spread / Demand
Scenario seedFixed passenger stream
Traffic periodOrigin mix (morning / evening / midday)
Arrival ratePer-tick Bernoulli arrival probability
Interfloor %Upper→upper chance instead of lobby
Door dwellStop time at each floor
Building knobsFloors, cars, capacity, target passengers

Metrics

  • Avg / Max wait (ticks) — hall call to board
  • Empty travel (floors) — floors moved empty (parking cost)
  • IdleFrac — share of car-ticks spent IDLE or PARKING; regime chip (parking-sensitive / mixed / saturated)
  • Ticks / Completed — makespan and throughput

Tech stack

Vanilla HTML · CSS · JavaScript · /elevator/