Why buses arrive in threes

This is the model from the film, running live. It starts with the buses evenly spaced. Leave it alone and watch the gaps, or switch on the holding rule.

The rules, all of them. A 12 km loop with 24 stops. Buses drive at a steady 8 metres a second and cannot overtake. People arrive at every stop at random. A bus opens its doors for 10 seconds, boards everyone waiting, and leaves. With the holding rule on, a bus may not leave a stop until that share of the even gap has passed since the last bus left it.

What it leaves out: buses here never fill up, nobody gets off slowly, and nobody is in charge. A real route has all three, which is why real buses come in threes and not in one long convoy. This has not been checked against real bus positions.