Class LaneBasedTemplateGTUType
- java.lang.Object
-
- org.opentrafficsim.core.gtu.TemplateGTUType
-
- org.opentrafficsim.road.gtu.generator.characteristics.LaneBasedTemplateGTUType
-
- All Implemented Interfaces:
Serializable
,Generator<GTUCharacteristics>
,LaneBasedGTUCharacteristicsGenerator
public class LaneBasedTemplateGTUType extends TemplateGTUType implements LaneBasedGTUCharacteristicsGenerator
Generate lane based GTUs using a template.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 29, 2015
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LaneBasedTemplateGTUType(GTUType gtuType, Generator<Length> lengthGenerator, Generator<Length> widthGenerator, Generator<Speed> maximumSpeedGenerator, LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory, Generator<Route> routeGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LaneBasedGTUCharacteristics
draw()
Generate the properties of the next GTU.String
toString()
-
Methods inherited from class org.opentrafficsim.core.gtu.TemplateGTUType
copyForGtuType, getGTUType
-
-
-
-
Constructor Detail
-
LaneBasedTemplateGTUType
public LaneBasedTemplateGTUType(GTUType gtuType, Generator<Length> lengthGenerator, Generator<Length> widthGenerator, Generator<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 Detail
-
draw
public final LaneBasedGTUCharacteristics draw() throws ProbabilityException, org.opentrafficsim.base.parameters.ParameterException
Generate the properties of the next GTU.- Specified by:
draw
in interfaceGenerator<GTUCharacteristics>
- Specified by:
draw
in interfaceLaneBasedGTUCharacteristicsGenerator
- Overrides:
draw
in classTemplateGTUType
- 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
public String toString()
- Overrides:
toString
in classTemplateGTUType
-
-