CHAPTER 4. CODING PROCESS
13
Moving the roadusers is done in (gld.sim) SimModel in the methods moveAll-
Roadusers, moveLane and moveRoaduserOnLane. moveAllRoadusers calls the
method moveLane for all inbound lanes when the lane has not moved yet at the
current cycle.
moveLane is moving the roadusers on a given lane. For every road user on this
lane, beginning with the first road user on the lane. A lot of different states are
possible for the road user. When a road user is moved, the traffic light controller
is informed. This information can be used by the algorithm for providing a table
containing Q-values for each trafficlight in its ‘green’ setting.1 A small flowchart
(not detailed) follows:
• calculate the ranges for every drivelane that this road user could get into.
• handle road users that possibly can cross a node
- handle road users that get to special nodes
- handle road users that are (nearly) at a sign,
can cross, there is place on the node.
-> move road user from present lane to destination lane
- handle road users that are nearly at a sign
can cross, there is no place on the node
->check if next lane should move and do it
- handle road users that are nearly at a sign
can cross but only moved some places
• handle road users that are not near a sign
moveRoaduserOnLane actually moves the road user and is called by move-
Lane. The road user is the first on the road or not. If it is the first, it can move
the maximum distance, if not, it checks the distance to the previous road user and
moves.
1 from info (gld.algo.tlc) TLController.java