Closed WJSchakel closed 3 months ago
There are two issues:
LaneChange
object of the model is consulted to figure out whether vehicles are changing lane, and the lane change fraction. In the last step of the lane change, the model already finalizes the lane change in this object. However, finalizeLaneChange()
on the vehicle, which deals with registration on the lanes, is not yet called. As a consequence, whatever fixes were in place that happened to correctly adjust the lane during a lane change given issue 1, were not active during the last step of the lane change.As a solution, two matters are changed:
LaneChange
object. For the vehicle position, the distance from the reference of the vehicle to the nose is simply added, regardless of slight rotation of the vehicle.Map
for the vehicle. In the last step of the lane change, LaneChange
indicated no lane change. However, as the vehicle is still in the Map
, it is known that this is the final step of the lane change. The target lane is taken and removed from the Map
. For this time step, the target lane is given as the lane. For following time steps, the normal in-lane procedure will follow as the vehicle is no longer present in the Map
(until a new lane change is initiated).
The information that is sent to FOSIM makes the vehicles jump lane sometimes. The following information is for example sent (one line per time step):
GTU 9 is at lane 0 GTU 9 changes right at 0.16666666666666666 and is at lane 1 GTU 9 changes right at 0.3333333333333333 and is at lane 1 GTU 9 changes right at 0.5 and is at lane 1 GTU 9 changes right at 0.6666666666666666 and is at lane 1 GTU 9 changes right at 0.8333333333333333 and is at lane 1 GTU 9 is at lane 0 GTU 9 is at lane 1
Clearly the before-last line is wrong.