Class LaneBasedGtuTemplate
java.lang.Object
org.opentrafficsim.core.gtu.GtuTemplate
org.opentrafficsim.road.gtu.generator.characteristics.LaneBasedGtuTemplate
- All Implemented Interfaces:
Serializable,Generator<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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLaneBasedGtuTemplate(GtuType gtuType, Generator<org.djunits.value.vdouble.scalar.Length> lengthGenerator, Generator<org.djunits.value.vdouble.scalar.Length> widthGenerator, Generator<org.djunits.value.vdouble.scalar.Speed> maximumSpeedGenerator, LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory, Generator<Route> routeGenerator) -
Method Summary
Methods inherited from class org.opentrafficsim.core.gtu.GtuTemplate
copyForGtuType, getGtuType
-
Constructor Details
-
LaneBasedGtuTemplate
public LaneBasedGtuTemplate(GtuType gtuType, Generator<org.djunits.value.vdouble.scalar.Length> lengthGenerator, Generator<org.djunits.value.vdouble.scalar.Length> widthGenerator, Generator<org.djunits.value.vdouble.scalar.Speed> maximumSpeedGenerator, LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory, Generator<Route> routeGenerator) throws NullPointerException - Parameters:
gtuType- GtuType; The GtuType to make it identifiable.lengthGenerator- Generator<Length>; Generator<Length> generator for the length of the GTU type (parallel with driving direction).widthGenerator- Generator<Length>; generator for the width of the GTU type (perpendicular to driving direction).maximumSpeedGenerator- Generator<Speed>; generator for the maximum speed of the GTU type (in the driving direction).strategicalPlannerFactory- LaneBasedStrategicalPlannerFactory<?>; Factory for the strategical planner (e.g., route determination)routeGenerator- Generator<Route>; route generator- Throws:
NullPointerException- when one or more parameters are null
-
-
Method Details
-
draw
public final LaneBasedGtuCharacteristics draw() throws ProbabilityException, org.opentrafficsim.base.parameters.ParameterExceptionGenerate the properties of the next GTU.- Specified by:
drawin interfaceGenerator<GtuCharacteristics>- Specified by:
drawin interfaceLaneBasedGtuCharacteristicsGenerator- Overrides:
drawin classGtuTemplate- Returns:
- the LaneBasedGtuCharacteristics with a drawn perception, strategical planner, and initial speed.
- Throws:
ProbabilityException- when a generator is improperly configuredorg.opentrafficsim.base.parameters.ParameterException- in case of a parameter problem.
-
toString
- Overrides:
toStringin classGtuTemplate
-