averbraeck / opentrafficsim

Open Source Multi-Level Traffic Simulator
BSD 3-Clause "New" or "Revised" License
28 stars 8 forks source link

GTU generation on multiple lanes #103

Closed WJSchakel closed 5 months ago

WJSchakel commented 5 months ago

A GTU can now only be generated on a single lane, i.e. its nose may not be on the next lane, and its rear may not be on a previous lane. We can support this, rather than throwing an exception, in the case where lanes have only a single next/previous lane for the GTU type.

WJSchakel commented 5 months ago

Init code is much simplified. Input is a single LanePosition and the enterLaneRecursive() method is used, which is also used after an instantaneous lane change. This does assume that lanes are neatly attached without overlap and gaps. A strategical planner can at that point not be used to request the next link after a split, so a split is not supported.

All code generating GTUs has been adapted.