0 decisions resolved on this page

Twelve intersections run by one table

Every second, each traffic light asks a 27-rule signal policy what to do: hold the green, switch, or let pedestrians cross. Switch to rush hour, or send an ambulance and watch the lights clear a path for it.

Mode
    Decisions
    0
    Round trip
    –
    Cars through
    0
    Avg wait
    –

    How it works

    1. A signal policy per mode

      Minimum and maximum greens, walk phases, queue-pressure thresholds and emergency-vehicle priority for normal, rush-hour and night modes, in 27 rules.

    2. Every light asks every second

      Each light sends its mode, phase, how long it's been green, the cars on each side, pedestrians waiting and whether an ambulance is coming. The table says hold, switch or walk.

    3. The simulation only moves cars

      Cars and pedestrians are simulated in the browser; every light change is the table's call. Send an ambulance and the emergency rules clear its path.

    The signal rules 27 rules · first match wins

    Policy, as writtenRun each traffic light. An emergency vehicle on the red side switches the light; on the green side it holds it. A walk phase lasts 5 seconds, then traffic resumes. Normal: hold at least 7 s, give pedestrians a walk after 18 s, switch after 30 s if anyone is waiting, switch when the green side is empty and someone waits on red, and switch under queue pressure (8+ waiting vs 2 or fewer on green, 14+ vs 5, 22+ vs 9). Rush hour: minimum 12 s, walk after 30 s, maximum 45 s, pressure at 12/3, 20/8, 30/14, and keep the green up to 35 s while 10+ cars are still flowing. Night: minimum 4 s, walk on request, maximum 20 s, switch on demand (3+ waiting vs none, 6+ vs 2) and rest on green when nobody waits. Otherwise keep the green.

    # ModePhaseGreen for (s)Cars on greenCars on redEmergency vehiclePedestrians waiting ActionReason Hits
    1 ·····Red side· Switch Emergency vehicle approaching
    2 ·····Green side· Hold Emergency vehicle approaching
    3 ·Walk< 5···· Hold Pedestrians crossing
    4 ·Walk····· Resume Crossing complete
    5 Normal·< 7···· Hold Minimum green (7s)
    6 Normal·≥ 18···yes Walk Pedestrian request
    7 Normal·≥ 30·≥ 1·· Switch Maximum green (30s)
    8 Normal··0≥ 1·· Switch Gap-out: green approach empty
    9 Normal··≤ 2≥ 8·· Switch Queue pressure (8+ waiting)
    10 Normal··≤ 5≥ 14·· Switch Queue pressure (14+ waiting)
    11 Normal··≤ 9≥ 22·· Switch Queue pressure (22+ waiting)
    12 Rush hour·< 12···· Hold Minimum green (12s)
    13 Rush hour·≥ 30···yes Walk Pedestrian request
    14 Rush hour·≥ 45·≥ 1·· Switch Maximum green (45s)
    15 Rush hour··0≥ 1·· Switch Gap-out: green approach empty
    16 Rush hour··≤ 3≥ 12·· Switch Queue pressure (12+ waiting)
    17 Rush hour··≤ 8≥ 20·· Switch Queue pressure (20+ waiting)
    18 Rush hour··≤ 14≥ 30·· Switch Queue pressure (30+ waiting)
    19 Rush hour·< 35≥ 10··· Hold Platoon still flowing
    20 Night·< 4···· Hold Minimum green (4s)
    21 Night·≥ 4···yes Walk Pedestrian request
    22 Night·≥ 20·≥ 1·· Switch Maximum green (20s)
    23 Night··0≥ 1·· Switch Gap-out: green approach empty
    24 Night··≤ 0≥ 3·· Switch Queue pressure (3+ waiting)
    25 Night··≤ 2≥ 6·· Switch Queue pressure (6+ waiting)
    26 Night···0·· Hold Night: rest on green
    27 ······· Hold Keep green

    These rules started as a paragraph of plain-English policy. Yours can too.

    See pricing