APPENDIX A. SOURCE CODE
78
if (currentNode != null && currentNode.getKeepTLDFlag()) {
currentNode. decrPhaseMinimal ();
}
for (int j = 0; j < tld [i ]. length; j++) { // for all inbound lanes in node
currentDec = tld[i][j];
curLane = tld [i ][j ]. getTL().getLane ();
int cntr = countRoadusers(curLane);
if (! tld [ i ][ j ]. getTL (). getState ())
currentDec . addKappa(cntr );
if (currentNode.getPhaseMinimal() <= 0 && currentDec.getKappa() >= TETA) {
currentDec. setQValue(currentDec. getKappa ());
CurrentNode. setKeepTLDFlag(false);
} else {
currentDec. setQValue (0);
}
}
}
return tld;
}
A.4 MorevtsSotlPlatoon
updateT LDs and decideT Ls of the Sotl-platoon traffic light controller is given
below.
public void updateTLDs() {
for ( int i = 0; i < tld . length ; i++) { // for all nodes
boolean switched = false ;
boolean platoonCrossing = false ;
int platoonRoaduserCount = 0;
int nrOfPlatoonLanes = 0;