CHAPTER 4. CODING PROCESS
red. There is a difference between a primary lane, and a secondary lane. Primary
lanes get green at the first half of the period. Secondary lanes get the second half.
This is again divided into turning left, and going straight on / right.
23
When a new traffic light controller is implemented, it has to be added in TLCFac-
tory.
This method is tested in the simulator with a map containg a primary road with 2
intersections. Secondary roads are intersecting with this primary road. When run-
ning the simulator, you can see that the traffic lights of the nodes on the primary
road have the same configuration at the same cycle.
Optim control assures (only in 1 direction) a green wave of lights on the pri-
mary road, once the roaduser has green.
Trafficlights at different nodes have a different phase. To keep track of the phase,
the difference is stored in the J unction. This difference is the time needed to
travel the distance of the lane in front of the light, phaseDif f =
IengthOfLane
maxAllowedSpeed'
The base of the phase is stored in T LC ontroller. The actual phase is calcu-
lated as the substraction: phase = phaseBase - phaseDif f . setPhaseDiffs of
M orevtsOptimT LC sets the phaseDiff of the nodes on the primary road. The
calculation of the phaseDiffs has to start at the beginning of the primary road
for the green wave. The first traffic light has a phaseDiff of 0, the second has a
phaseDif f1 = t1, the third has aphaseDiff2 = t1 + t2, and so on.
In the editor the support is added for defining nodes which have to deliver a green
wave and specifying the start and the finish of a green wave. The direction of
the green wave is set by start and f inish. The roads in between need to be
primary. In Junction is added: isGreenWaveNode, isGreenWaveStart, setGreen-
WaveStart, isGreenWaveFinish and setGreenWaveFinish. Those data members
need to be stored/loaded by load and saveSelf. EditJunctionPanel is modified to
support specifying the data. SimJunctionPanel is modified to see these green wave
/ start / finish values. This is succesfully tested.