Operations · Simulator 075
Cars arrive at random on two crossing roads and a signal lets each road go in turn. Change how long each road gets green and how busy each road is. Watch queues build on red and clear on green, and find timings that keep delay low without letting either queue run away.
Each road gets an effective green time g in a cycle of length C. Every phase change also loses L = 4 s while the junction clears, so C = g₁ + g₂ + 2L. While a road has green and a queue, cars leave at the saturation flow s = 1800 cars/h (one every 2 s). So a road can serve at most
capacity = s × g / C degree of saturation x = q / capacity
where q is the arrival rate. If x ≥ 1 the queue grows every cycle and never clears. Below that, Webster's formula estimates the average delay per car:
d ≈ 0.9 × [ C(1 − g/C)² / (2(1 − x g/C)) + x² / (2q(1 − x)) ]
The first term is the wait caused by red; the second is the extra delay from random arrivals. Short cycles waste a larger share of time on changes; long cycles make cars wait through long reds. Webster's optimum cycle is roughly C₀ = (1.5 × total lost time + 5) / (1 − Σ q/s).
One lane per road, no turning, Poisson arrivals, and cars leave at a constant headway. Webster's formula is an approximation and usually reads a little below simulation. Averages need several minutes of simulated time to settle.
A junction has 700 cars/h on the main road and 350 cars/h on the side road, with s = 1800 cars/h and 4 s lost per phase. With a 60 s cycle, roughly how should the green time be split so that both roads have the same degree of saturation?
The total green is 60 − 8 = 52 s. Equal x means green in proportion to demand: main road 52 × 700/1050 ≈ 35 s, side road ≈ 17 s. Then the main road's capacity is 1800 × 35/60 = 1050 cars/h, and the side road gets 1800 × 17/60 = 510 cars/h, so x ≈ 0.67 and 0.69. Try it: arrivals 700 and 350, greens 35 and 17.