Nine intersections form a 3×3 street grid. Vehicles arrive at the four outer edges as an independent Poisson process and travel straight through the grid, queueing at every red light they meet. Each intersection alternates between two phases: EW (east/west through movements) and NS (north/south through movements) — the same paired-phase logic real signal controllers use.
In Max-Pressure mode, each intersection independently runs the control law from Varaiya's back-pressure theory: every check, it computes a pressure value per candidate phase from its own queues and the queues immediately downstream,
P(phase) = Σ over movements m in phase of [ q_upstream(m) − q_downstream(m) ]
switch to argmax P(phase) whenever time_in_phase ≥ min_green
A movement's pressure is high when its own queue is long and the queue it would feed into is short — i.e. green there both clears local congestion and won't just push cars into the next jam. This requires no fixed cycle or offset and reacts instantly to uneven demand.
Fixed-Time mode ignores queue state entirely: every intersection just alternates EW/NS every min_green seconds, the naive baseline every adaptive scheme is measured against. Switch modes with identical demand to see queue length and throughput diverge in real time.
- Arrival rate — Poisson demand injected at each of the twelve boundary approaches.
- Saturation flow rate — vehicles/minute a green lane can discharge, the service rate of the queue.
- Minimum green — the guaranteed green duration before a switch is even considered (prevents flicker and matches pedestrian-clearance constraints in real controllers).