fn multi_way_stages(i: &Intersection) -> Option<ControlTrafficSignal>
Expand description

Build stages. First find roads that are straight across, they are either one-way or two-way. For one-way, add any right or left turns, thus completing the stage. For two-way, two stages will be added. The first stage has protected straight, and right and yield left. The second stage has protected left. Lastly, sometimes oncomming left turns can’t both be protected, if this occurs the 2nd stage will have one direction protected and the other yield and a 3rd, inverse, stage will be added which has the other direction’s left protected and other yield. Finally, any turns which weren’t assigned, because there are no straights or there are more than just pairs of straight intersections, are assigned a stage. These, too are handled as pairs until one remains, which is handled as a one-way.