(Use all default settings for the demo)
Around 10 minutes in the simulation GTU 77 is already registered in a lane that it changes into.
Deeper cause: GTU 77 is accidentally registered in a wrong lane when it changes lane.
Even deeper cause: GTU is not unregistered from a lane at the time that its rear leaves the lane. In stead it is unregistered one ULP before the next evaluation time. This is wrong for two reasons:
1: One ULP of the sample interval gets added to the current simulation time and subsequently rounded away.
2: The GTU should be unregistered at the time its rear leaves the lane; not just before its next move evaluation
3: If the unregister event gets sorted after the next evaluation event AND that next evaluation event results in a lane change, the GTU gets unregistered in all current lanes (including the one it is no longer on) and then registered on all new lanes (including one that is not on). That registration on a lane that the GTU is not actually on results in the error when the GTU is entering that lane again (after making it round the circular road).
1: All GTUs must maintain a list of scheduled triggers organized for all lanes that the GTU is registered on. This allows proper removal of those triggers when a lane change occurs.
2: The unregister event must be schedule for the exact time that the rear of the GTU leaves the lane.
All triggers should be scheduled for the time that the relative position of the GTU passes into or out of the lane or over the sensor.
Output diagnostics when a GTU is registered in a lane that it is not really on.