ID - the ID type of the GTU (e.g., String or Integer)public abstract class AbstractGTUGenerator<ID> extends Object
Copyright (c) 2013-2014 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,
OTSDEVSSimulatorInterface simulator,
GTUType<ID> gtuType,
Class<?> gtuClass,
GTUFollowingModel gtuFollowingModel,
LaneChangeModel laneChangeModel,
DistContinuousDoubleScalar.Abs<SpeedUnit> initialSpeedDist,
DistContinuousDoubleScalar.Rel<TimeUnit> interarrivelTimeDist,
long maxGTUs,
DoubleScalar.Abs<TimeUnit> startTime,
DoubleScalar.Abs<TimeUnit> endTime,
Lane lane,
RouteGenerator routeGenerator) |
public AbstractGTUGenerator(String name, OTSDEVSSimulatorInterface simulator, GTUType<ID> gtuType, Class<?> gtuClass, GTUFollowingModel gtuFollowingModel, LaneChangeModel laneChangeModel, DistContinuousDoubleScalar.Abs<SpeedUnit> initialSpeedDist, DistContinuousDoubleScalar.Rel<TimeUnit> interarrivelTimeDist, long maxGTUs, DoubleScalar.Abs<TimeUnit> startTime, DoubleScalar.Abs<TimeUnit> endTime, Lane lane, RouteGenerator routeGenerator) throws RemoteException, 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 instantiategtuFollowingModel - the GTU following model to uselaneChangeModel - the lane change model to useinitialSpeedDist - 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 on -- at the end for nowrouteGenerator - RouteGenerator; the route generator that will create a route for each generated GTUSimRuntimeException - when simulation scheduling failsRemoteException - when remote simulator cannot be reachedprotected final void generate()
throws Exception
Exception - when something in the generation fails.public final HeadwayGTU headway(DoubleScalar.Rel<LengthUnit> maxDistance, Route route, Lane generatorLane) throws RemoteException, NetworkException
maxDistance - DoubleScalar.Rel<LengthUnit>; the maximum distance to look for a leaderroute - Route; the route that this GTU intends to takegeneratorLane - Lane; the lane on which the GTU is generatedRemoteException - on communications failureNetworkException - on network inconsistencyprotected final void checkCarBuilderList()
throws Exception
Exception - on any problempublic abstract OTSDEVSSimulatorInterface getSimulator()
public abstract DistContinuousDoubleScalar.Rel<LengthUnit> getLengthDist()
public abstract DistContinuousDoubleScalar.Rel<LengthUnit> getWidthDist()
public abstract DistContinuousDoubleScalar.Abs<SpeedUnit> getMaximumSpeedDist()
public final String getName()
public final Class<?> getGtuClass()
public final GTUFollowingModel getGtuFollowingModel()
public final DistContinuousDoubleScalar.Abs<SpeedUnit> getInitialSpeedDist()
public final DistContinuousDoubleScalar.Rel<TimeUnit> getInterarrivelTimeDist()
public final long getMaxGTUs()
public final DoubleScalar.Abs<TimeUnit> getStartTime()
public final DoubleScalar.Abs<TimeUnit> getEndTime()
public final RouteGenerator getRouteGenerator()
public final void setRouteGenerator(RouteGenerator routeGenerator)
routeGenerator - set routeGenerator.Copyright © 2014–2015 Delft University of Technology. All rights reserved.