public abstract class AbstractGTUGenerator extends Object implements Serializable, GTUGenerator
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
protected long |
numberGTUs
Number of generated GTUs.
|
Constructor and Description |
---|
AbstractGTUGenerator(String name,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
GTUType gtuType,
Class<?> gtuClass,
ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit> initialSpeedDist,
ContinuousDistDoubleScalar.Rel<Duration,DurationUnit> interarrivelTimeDist,
long maxGTUs,
Time startTime,
Time endTime,
Lane lane,
Length position,
GTUDirectionality direction,
GTUColorer gtuColorer,
LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory,
RouteGenerator routeGenerator,
OTSNetwork network) |
public AbstractGTUGenerator(String name, DEVSSimulatorInterface.TimeDoubleUnit simulator, GTUType gtuType, Class<?> gtuClass, ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit> initialSpeedDist, ContinuousDistDoubleScalar.Rel<Duration,DurationUnit> interarrivelTimeDist, long maxGTUs, Time startTime, Time endTime, Lane lane, Length position, GTUDirectionality direction, GTUColorer gtuColorer, LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory, RouteGenerator routeGenerator, OTSNetwork network) throws SimRuntimeException
name
- the name of the generatorsimulator
- the simulator to schedule the start of the generationgtuType
- the type of GTU to generategtuClass
- the GTU class to instantiateinitialSpeedDist
- distribution of the initial speed of the GTUinterarrivelTimeDist
- distribution of the interarrival timemaxGTUs
- maximum number of GTUs to generatestartTime
- start time of generation (delayed start)endTime
- end time of generationlane
- the lane to generate the GTU onposition
- position on the lane, relative to the design line of the linkdirection
- the direction on the lane in which the GTU has to be generated (DIR_PLUS, or DIR_MINUS)gtuColorer
- the GTUColorer to usestrategicalPlannerFactory
- the lane-based strategical planner factory to userouteGenerator
- route generatornetwork
- the network to register the generated GTUs intoSimRuntimeException
- when simulation scheduling failsprotected final void generate() throws Exception
Exception
- when something in the generation fails.protected final boolean enoughSpace(LaneBasedIndividualGTU.LaneBasedIndividualCarBuilder carBuilder) throws NetworkException, GTUException
carBuilder
- the car to be generatedNetworkException
- when the speed limit of the lane is not knownGTUException
- if GTU does not have a position on the lane where it is registeredpublic final Headway headway(Length maxDistance, Lane generatorLane) throws GTUException
maxDistance
- Length; the maximum distance to look for a leadergeneratorLane
- Lane; the lane on which the GTU is generatedGTUException
- on network inconsistencyprotected final void checkCarBuilderList() throws Exception
Exception
- on any problempublic abstract DEVSSimulatorInterface.TimeDoubleUnit getSimulator()
public abstract ContinuousDistDoubleScalar.Rel<Length,LengthUnit> getLengthDist()
public abstract ContinuousDistDoubleScalar.Rel<Length,LengthUnit> getWidthDist()
public abstract ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit> getMaximumSpeedDist()
public final String getName()
public final GTUType getGtuType()
public final Class<?> getGtuClass()
public final ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit> getInitialSpeedDist()
public final ContinuousDistDoubleScalar.Rel<Duration,DurationUnit> getInterarrivelTimeDist()
public final long getMaxGTUs()
public final Time getStartTime()
public final Time getEndTime()
public final GTUColorer getGtuColorer()
public final LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> getStrategicalPlannerFactory()
public DirectedPoint getLocation() throws RemoteException
getLocation
in interface Locatable
RemoteException
public javax.media.j3d.Bounds getBounds() throws RemoteException
getBounds
in interface Locatable
RemoteException
public Map<DirectedPoint,Integer> getQueueLengths()
getQueueLengths
in interface GTUGenerator
Copyright © 2014–2018 Delft University of Technology. All rights reserved.