flow
Place a fire in Dubai Marina and watch thousands of agents evacuate over the real OpenStreetMap road network, then make one operator decision and measure how much clearance time it saves.
Key metrics
Architecture
A deterministic, fixed-timestep Rust engine loads a district's OpenStreetMap roads, speed limits, traffic signals and buildings, and moves agents along lanes with IDM car-following and A* routing. During an evacuation it steps 16 sim-ticks per 30 Hz frame and streams binary snapshots and live metrics over a websocket to a TypeScript viewer, which draws roads, extruded buildings and water itself with deck.gl over a MapLibre basemap. A command console sends typed or spoken requests through Claude, which drives the same commands as the buttons.
Case study
flow
An agent-based evacuation digital twin of Dubai. Place an emergency, watch the population and traffic evacuate in real time over the real city, then change one operator decision and measure what it buys in clearance time.
Why
Evacuation planning is usually a static study. flow asks the operator's question live: if I do this, how much faster does the area clear? Because the engine is deterministic and seeded, the same city, seed and incident run twice with one decision changed, so the gap between the two runs is the effect of that decision.
What it does
- The real district. Dubai Marina's OpenStreetMap roads, speed limits, 106 traffic signals, buildings and water, drawn by the viewer itself. Downtown Dubai, Palm Jumeirah, Abu Dhabi Corniche and a draw-your-own area are also selectable.
- Place an incident. Click a tower to start a fire: nearby roads close, traffic reroutes, a danger-zone ring marks who must leave and nearby signals switch to green-out, red-in.
- Measure it. A HUD shows % evacuated, clearance time (ETE), exit rate and the number still in the danger zone, with an S-curve of % evacuated against sim time.
- Make a decision. Reset keeps the last run as a ghost curve. Run again with Maximize Egress (contraflow and green-out on the egress corridors) and read the difference as ΔETE.
- Eyes on the scene. A drone launched from a ground-team point flies to the incident and orbits it in a live FPV window.
- Talk to it. A command console takes typed or spoken requests ("start a fire near the marina", "maximize egress", "what's the clearance time?") and drives the sim through Claude.
- Logistics mode. The same engine runs a UAE-wide delivery operation with on-time KPIs; an incident on a highway makes deliveries reroute.
How it works
A Rust engine (flow-net, flow-core, flow-server) loads the district from OpenStreetMap, models each lane as a polyline with cars sorted along it, and moves agents with IDM car-following and A* routing on a fixed timestep. Evacuees leave after a Rayleigh-distributed mobilisation delay. During an evacuation the engine runs 16 sim-ticks per 30 Hz frame, so a ten-minute evacuation is designed to play out in under a minute of wall-clock time, and streams snapshots and metrics over a websocket. The TypeScript viewer renders with deck.gl over a MapLibre basemap, needs no paid map keys, and interpolates between frames.
A prototype. Population is seeded synthetically, not from real density data, and contraflow is modelled as queue relief on the egress corridors rather than a calibrated lane-capacity model.
Tech stack
Gallery