FreeSimulationNo signup

Traffic Intersection Simulator

A four-way signalized intersection in your browser. Move the sliders, watch queues form, and find the signal timing that minimizes wait.

Ready
Step 0 / 0
Agents: 0
NS CarEW CarIntersectionRoadSidewalk
10/s

Parameters

0.200
01
0.150
01
30
1060
30
1060

Tweak parameters, then press Reset to apply.

What you just saw

Vehicles arrive at each approach as a Poisson process, queue at the stop bar, and clear when the light turns green. When arrival rate exceeds the capacity of a phase, queues grow without bound — the classic failure mode of under-timed signals. The average wait time is sensitive to both arrival rate and green-phase duration, and the optimum depends on both approaches together.

The science behind it

Microscopic traffic simulation dates back to the 1950s. The per-lane Poisson arrival + fixed-time signal model here is the simplest useful version, underlying the Webster (1958) delay formula still taught in transportation engineering. Modern operational tools (VISSIM, AIMSUN, SUMO) add car-following dynamics, lane-changing, and turning movements, but the queue-growth intuition from this model carries over.

Try these experiments

  1. 1. Balanced demand

    Settings: arrival_rate_ns=0.2 arrival_rate_ew=0.2

    What to look for: Both queues clear each cycle. Average wait sits near the half-cycle time.

  2. 2. Mismatched signal

    Settings: arrival_rate_ns=0.4 arrival_rate_ew=0.1 green_duration_ns=20

    What to look for: NS queue grows without bound. Classic signal mis-timing failure mode.

  3. 3. Rush hour

    Settings: arrival_rate_ns=0.6 arrival_rate_ew=0.5

    What to look for: Both approaches saturate. No signal timing makes the intersection work — you need more capacity.

Sprint 1 scaffold. Full long-form article, references, and FAQ will land in the content sprints (3–6). The simulation above is already wired to the production worker.
SimLab

Run this at 100x scale

Traffic intersection runs in your browser up to 1 intersection agents. With SimLab, the same model runs on GPU at city-wide network, with ensemble parameter sweeps and publication-ready output.

from scirouter import SciRouter
client = SciRouter(api_key="sk-sci-...")
result = client.simulation.run(
    model="intersection",
    params={"arrival_rate_ns": 0.3, "arrival_rate_ew": 0.2,
            "green_duration_ns": 30, "green_duration_ew": 25},
    steps=3600, seed=42,
)
print(result.metrics["average_wait"])

Related simulations

Frequently asked questions

Can I plan a real intersection with this?

For teaching and quick back-of-envelope sizing, yes. For operational planning, use VISSIM or SUMO with real turning counts, gap acceptance, pedestrian phases, and emergency pre-emption.

Where does the saturation flow rate come from?

The model assumes a fixed per-lane service rate during green. Real-world saturation flow varies by lane geometry, grade, and vehicle mix — typically 1700–2000 vehicles per hour per lane.