Class LaneBasedGtuTemplate
java.lang.Object
org.opentrafficsim.core.gtu.GtuTemplate
org.opentrafficsim.road.gtu.generator.characteristics.LaneBasedGtuTemplate
- All Implemented Interfaces:
Supplier<GtuCharacteristics>,LaneBasedGtuCharacteristicsGenerator
public class LaneBasedGtuTemplate
extends GtuTemplate
implements LaneBasedGtuCharacteristicsGenerator
Generate lane based GTUs using a template.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.opentrafficsim.core.gtu.GtuTemplate
copyForGtuType, get, getGtuType
-
Constructor Details
-
LaneBasedGtuTemplate
public LaneBasedGtuTemplate(GtuType gtuType, Supplier<Length> lengthSupplier, Supplier<Length> widthSupplier, Supplier<Speed> maximumSpeedSupplier, LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory, Supplier<Route> routeSupplier) throws NullPointerException Constructor.- Parameters:
gtuType- The GtuType to make it identifiable.lengthSupplier- Supplier<Length> Supplier for the length of the GTU type (parallel with driving direction).widthSupplier- Supplier for the width of the GTU type (perpendicular to driving direction).maximumSpeedSupplier- Supplier for the maximum speed of the GTU type (in the driving direction).strategicalPlannerFactory- Factory for the strategical planner (e.g., route determination)routeSupplier- route Supplier- Throws:
NullPointerException- when one or more parameters are null
-
-
Method Details
-
draw
Generate the properties of the next GTU.- Specified by:
drawin interfaceLaneBasedGtuCharacteristicsGenerator- Returns:
- the LaneBasedGtuCharacteristics with a drawn perception, strategical planner, and initial speed.
-
toString
- Overrides:
toStringin classGtuTemplate
-