CHAPTER 4. CODING PROCESS
25
0. The source code of decideTLs() is available in the appendix.
KeeptLDF lag is used because traffic lights have to keep their configuration until
a request for green light occurs. Theuseofa flag is needed because switchT raf ficLights
of SignController will search for a new traffic light configuration when the flag
is not used, or when the flag is set to false.
Sotl-phase control is the same as sotl - request, except that decisions of traffic
lights have to hold for a minimum phase.
In updateT LDs() all updates are done of keepT LDF lag and phaseMinimal of
N ode, and kappa of T LDecision. When a traffic light has been switched to green
in the previous cycle for a specific node, the keepT LDF lag of that node is set to
true and the minimal green time is set to PHASE_MIN. kappa of T LDecision is
set to zero for all traffic lights which are switched to green.
decideT Ls() will first call updateTLDs() for updating the parameters. Then
for all nodes it will update the time the green configuration has to be kept. For
all inbound lanes it will add the count of cars to kappa and it will check if this
kappa has reached its threshold. When this is the case and the minimal green
time has been reached, the Q - value of T LDecision will be set to kappa and
keepT LDF lag is set to false for allowing the traffic lights to switch. If kappa
did not reach the threshold or the minimal green time has not been reached, the
Q - value is set to zero.
The testing of this traffic light controller was succesfull.
Sotl-platoon control adds two restrictions to sotl-phase for regulating the size
of platoons. Before changing red lights to green, it checks if a platoon is not cross-
ing through, in order not to break it.
A red light is not changed to green if there is at least one car on the crossing
street approaching within omega patches from the intersection. For our simula-