← All projects · Smart traffic write-up
Live demo · replay of simulated runs
Watch a PPO agent and a fixed-time plan run the same junction
Each run is one simulated hour at a four-way junction in SUMO, recorded second by second. Switch the controller and the traffic pattern and the clock stays put, so you can compare the same moment.
This is a replay, not live traffic or a model running now. The runs were recorded from SUMO 1.25 with the trained PPO policy and with the best fixed-time plan tested (10 s greens), on evaluation seeds 1 to 5. The counters are recomputed from the recording, and every run's final numbers match results/eval_episodes.csv.
Loading…
- moving
- stopped (speed under 0.1 m/s)
- signal at each stop line
0:0060:00
Controller
Traffic pattern
–mean wait per vehicle so far (s): stopped seconds ÷ vehicles entered
–simulated time
–signal
–stopped now
–stopped seconds, total
–vehicles entered
–vehicles finished
–green switches
–longest queue so far
The full-hour results
| Traffic pattern | PPO agent | Fixed-time 10 s | Better |
|---|---|---|---|
| Loading… | |||
Computed in your browser from the recorded runs; demo/record.py checks they equal results/eval_summary.csv. The full table, with the 30 s and 42 s plans, is in the write-up.
What you're watching
- One junction, one lane per approach, all traffic straight through: 200 vehicles an hour from each side.
- Every 5 s the PPO agent picks which direction gets green. A switch runs a 3 s yellow first and is refused until the green has lasted 10 s.
- The fixed-time plan gives each direction 10 s of green, then the same 3 s yellow.
- On regular arrivals (one car every 18 s per side, the pattern it trained on) PPO switched 199 times on every seed: it learned the rhythm of that demand.
- On random arrivals at the same average rate it reacts to the queues, but the simple 10 s plan waits less. The edge didn't carry over.
- The view shows the 120 m around the junction; each approach is 243 m long.