T
- type of demand category, typically a Category in an ODMatrix or a GTUTypepublic abstract class Platoons<T> extends Object
Platoons.ofCategory(...).addPlatoon(...).addGtu(...).addGtu(...).addPlatoon(...).addGtu(...).addGtu(...).start();
.
Method addGtu(...)
may only determine a generation time if other info is set by fixInfo(...)
.LaneBasedGTUCharacteristicsGenerator
or GTUCharacteristicsGeneratorOD
. Use
ofGtuType()
or ofCategory()
respectively.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
Platoons<T> |
addGtu(Time time)
Add GTU to the current platoon.
|
Platoons<T> |
addGtu(Time time,
Node origin,
Node destination,
T category)
Add GTU to the current platoon.
|
Platoons<T> |
addPlatoon(Time start,
Time end)
Add a platoon.
|
FrequencyVector |
compensate(T category,
FrequencyVector demand,
TimeVector time,
Interpolation interpolation)
Creates a demand vector in which the platoon demand has been compensated from the input demand vector.
|
Platoons<T> |
fixInfo(Node origin,
Node destination,
T category)
Fix all info except time for GTU's added hereafter.
|
protected LaneBasedGTUGenerator |
getGenerator()
Returns the vehicle generator for sub classes.
|
protected Set<LaneDirection> |
getPosition()
Returns the position for sub classes.
|
static Platoons<Category> |
ofCategory(GTUCharacteristicsGeneratorOD characteristics,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
StreamInterface stream,
Set<LaneDirection> position)
Creates a
Platoon<Category> instance for platoons. |
static Platoons<GTUType> |
ofGtuType(LaneBasedGTUCharacteristicsGenerator characteristics,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
StreamInterface stream,
Set<LaneDirection> position)
Creates a
Platoon<GTUType> instance for platoons. |
protected abstract void |
placeGtu(org.opentrafficsim.road.gtu.generator.Platoons.PlatoonGtu<T> platoonGtu)
Places the next platoon GTU and schedules the next one.
|
protected void |
start()
Starts the events.
|
void |
start(LaneBasedGTUGenerator generator)
Sets the generator and starts the events.
|
public static Platoons<Category> ofCategory(GTUCharacteristicsGeneratorOD characteristics, DEVSSimulatorInterface.TimeDoubleUnit simulator, StreamInterface stream, Set<LaneDirection> position)
Platoon<Category>
instance for platoons.characteristics
- GTUCharacteristicsGeneratorOD; characteristics generatorsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; simulatorstream
- StreamInterface; random number streamposition
- Set<LaneDirection>; positionpublic static Platoons<GTUType> ofGtuType(LaneBasedGTUCharacteristicsGenerator characteristics, DEVSSimulatorInterface.TimeDoubleUnit simulator, StreamInterface stream, Set<LaneDirection> position)
Platoon<GTUType>
instance for platoons.characteristics
- LaneBasedGTUCharacteristicsGenerator; characteristics generatorsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; simulatorstream
- StreamInterface; random number streamposition
- Set<LaneDirection>; positionpublic Platoons<T> addPlatoon(Time start, Time end) throws SimRuntimeException
addGtu
.start
- Time; start timeend
- Time; end timeSimRuntimeException
- on exceptionpublic Platoons<T> fixInfo(Node origin, Node destination, T category)
origin
- Node; origindestination
- Node; destinationcategory
- T; categorypublic Platoons<T> addGtu(Time time)
fixInfo
.time
- Time; time of generationIllegalStateException
- if no fixed info was set using fixInfo
public Platoons<T> addGtu(Time time, Node origin, Node destination, T category)
time
- Time; time of generationorigin
- Node; origindestination
- Node; destinationcategory
- T; categoryIllegalStateException
- if no platoon was started or time is outside of the platoon time rangepublic void start(LaneBasedGTUGenerator generator) throws SimRuntimeException
generator
- LaneBasedGTUGenerator; GTU generatorSimRuntimeException
- if start of first platoon is in the pastprotected LaneBasedGTUGenerator getGenerator()
protected Set<LaneDirection> getPosition()
protected void start() throws SimRuntimeException
SimRuntimeException
- if start of first platoon is in the pastpublic FrequencyVector compensate(T category, FrequencyVector demand, TimeVector time, Interpolation interpolation)
category
- T; categorydemand
- FrequencyVector; demand vectortime
- TimeVector; time vectorinterpolation
- Interpolation; interpolationprotected abstract void placeGtu(org.opentrafficsim.road.gtu.generator.Platoons.PlatoonGtu<T> platoonGtu) throws SimRuntimeException, NamingException, GTUException, NetworkException, OTSGeometryException, ProbabilityException, ParameterException
platoonGtu
- PlatoonGtu<T>; info of GTU to generateSimRuntimeException
- on exceptionNamingException
- on exceptionGTUException
- on exceptionNetworkException
- on exceptionOTSGeometryException
- on exceptionParameterException
- on exceptionProbabilityException
- on exceptionCopyright © 2014–2019 Delft University of Technology. All rights reserved.