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,
                    nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit simulator,
                    org.opentrafficsim.core.gtu.GTUType gtuType,
                    Class<?> gtuClass,
                    org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Speed,org.djunits.unit.SpeedUnit> initialSpeedDist,
                    org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Duration,org.djunits.unit.DurationUnit> interarrivelTimeDist,
                    long maxGTUs,
                    org.djunits.value.vdouble.scalar.Time startTime,
                    org.djunits.value.vdouble.scalar.Time endTime,
                    Lane lane,
                    org.djunits.value.vdouble.scalar.Length position,
                    org.opentrafficsim.core.gtu.GTUDirectionality direction,
                    org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer,
                    LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory,
                    org.opentrafficsim.core.network.route.RouteGenerator routeGenerator,
                    org.opentrafficsim.core.network.OTSNetwork network)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
checkCarBuilderList()
Check if car can be generated. 
 | 
protected boolean | 
enoughSpace(LaneBasedIndividualGTU.LaneBasedIndividualCarBuilder carBuilder)
Check if the car to be built is not overlapping with another GTU on the same lane, and if it has enough headway to be
 generated safely. 
 | 
protected void | 
generate()
Generate a GTU. 
 | 
javax.media.j3d.Bounds | 
getBounds() | 
org.djunits.value.vdouble.scalar.Time | 
getEndTime()  | 
Class<?> | 
getGtuClass()  | 
org.opentrafficsim.core.gtu.animation.GTUColorer | 
getGtuColorer()  | 
org.opentrafficsim.core.gtu.GTUType | 
getGtuType()  | 
org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Speed,org.djunits.unit.SpeedUnit> | 
getInitialSpeedDist()  | 
org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Duration,org.djunits.unit.DurationUnit> | 
getInterarrivelTimeDist()  | 
abstract org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Length,org.djunits.unit.LengthUnit> | 
getLengthDist()  | 
nl.tudelft.simulation.language.d3.DirectedPoint | 
getLocation() | 
long | 
getMaxGTUs()  | 
abstract org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Speed,org.djunits.unit.SpeedUnit> | 
getMaximumSpeedDist()  | 
String | 
getName()  | 
Map<nl.tudelft.simulation.language.d3.DirectedPoint,Integer> | 
getQueueLengths()
Returns the locations and lengths of generation queues. 
 | 
abstract nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit | 
getSimulator()  | 
org.djunits.value.vdouble.scalar.Time | 
getStartTime()  | 
LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> | 
getStrategicalPlannerFactory()  | 
abstract org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Length,org.djunits.unit.LengthUnit> | 
getWidthDist()  | 
Headway | 
headway(org.djunits.value.vdouble.scalar.Length maxDistance,
       Lane generatorLane)
Check the available headway for GTU that is about to be constructed. 
 | 
public AbstractGTUGenerator(String name, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit simulator, org.opentrafficsim.core.gtu.GTUType gtuType, Class<?> gtuClass, org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Speed,org.djunits.unit.SpeedUnit> initialSpeedDist, org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Duration,org.djunits.unit.DurationUnit> interarrivelTimeDist, long maxGTUs, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime, Lane lane, org.djunits.value.vdouble.scalar.Length position, org.opentrafficsim.core.gtu.GTUDirectionality direction, org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer, LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory, org.opentrafficsim.core.network.route.RouteGenerator routeGenerator, org.opentrafficsim.core.network.OTSNetwork network) throws nl.tudelft.simulation.dsol.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 intonl.tudelft.simulation.dsol.SimRuntimeException - when simulation scheduling failsprotected final void generate()
                       throws Exception
Exception - when something in the generation fails.protected final boolean enoughSpace(LaneBasedIndividualGTU.LaneBasedIndividualCarBuilder carBuilder) throws org.opentrafficsim.core.network.NetworkException, org.opentrafficsim.core.gtu.GTUException
carBuilder - the car to be generatedorg.opentrafficsim.core.network.NetworkException - when the speed limit of the lane is not knownorg.opentrafficsim.core.gtu.GTUException - if GTU does not have a position on the lane where it is registeredpublic final Headway headway(org.djunits.value.vdouble.scalar.Length maxDistance, Lane generatorLane) throws org.opentrafficsim.core.gtu.GTUException
maxDistance - Length; the maximum distance to look for a leadergeneratorLane - Lane; the lane on which the GTU is generatedorg.opentrafficsim.core.gtu.GTUException - on network inconsistencyprotected final void checkCarBuilderList()
                                  throws Exception
Exception - on any problempublic abstract nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit getSimulator()
public abstract org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Length,org.djunits.unit.LengthUnit> getLengthDist()
public abstract org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Length,org.djunits.unit.LengthUnit> getWidthDist()
public abstract org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Speed,org.djunits.unit.SpeedUnit> getMaximumSpeedDist()
public final String getName()
public final org.opentrafficsim.core.gtu.GTUType getGtuType()
public final Class<?> getGtuClass()
public final org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Speed,org.djunits.unit.SpeedUnit> getInitialSpeedDist()
public final org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<org.djunits.value.vdouble.scalar.Duration,org.djunits.unit.DurationUnit> getInterarrivelTimeDist()
public final long getMaxGTUs()
public final org.djunits.value.vdouble.scalar.Time getStartTime()
public final org.djunits.value.vdouble.scalar.Time getEndTime()
public final org.opentrafficsim.core.gtu.animation.GTUColorer getGtuColorer()
public final LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> getStrategicalPlannerFactory()
public nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
                                                            throws RemoteException
getLocation in interface nl.tudelft.simulation.dsol.animation.LocatableRemoteExceptionpublic javax.media.j3d.Bounds getBounds()
                                 throws RemoteException
getBounds in interface nl.tudelft.simulation.dsol.animation.LocatableRemoteExceptionpublic Map<nl.tudelft.simulation.language.d3.DirectedPoint,Integer> getQueueLengths()
getQueueLengths in interface GTUGeneratorCopyright © 2014–2018 Delft University of Technology. All rights reserved.