Home▸Fluid Dynamics & Aerodynamics▸City Traffic Flow — 2D Signal-Controlled Grid Simulator

City Traffic Flow — 2D Signal-Controlled Grid Simulator

A top-down 3×3 grid of signal-controlled avenues — adjust trip demand, signal-cycle length, autonomous-vehicle share and speed limit to watch throughput, average speed and queue length respond in real time.

Fluid Dynamics & Aerodynamics2DModerate60 FPS⇄ 3D version
2d-city-flow-dynamics ↗ Open standalone

This 2D companion drives the same signal-controlled traffic-flow mechanic as the 3D version — a 3×3 grid of two-way avenues meeting at nine intersections, one shared traffic-light clock alternating horizontal and vertical green phases, cars that brake for red lights and keep a following gap — but draws it as a flat top-down Canvas2D map instead of an orbitable night-city scene. Raise trip demand or autonomous-vehicle share and watch throughput climb and the average speed hold up; lengthen the signal cycle and watch queues build behind red lights instead.

⚙ Under the hood

A shared traffic-light clock alternates green between horizontal and vertical approaches on a 3×3 grid; cars target a cruising speed set by demand, autonomy and speed limit, brake for red lights and keep a minimum following gap, producing realistic throughput, average-speed and queue-length readouts.

traffic flowurban mobilitysignal controlcar followingqueueingcanvas2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)