public class Platoons extends Object
new Platoons(...).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
. In the
former case the origin and destination nodes as well as the OD category can be null
.
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.
Constructor and Description |
---|
Platoons(LaneBasedGTUGenerator generator,
GTUCharacteristicsGeneratorOD characteristics,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
StreamInterface stream,
Set<DirectedLanePosition> position)
Constructor.
|
Platoons(LaneBasedGTUGenerator generator,
LaneBasedGTUCharacteristicsGenerator characteristics,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
Set<DirectedLanePosition> position)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Platoons |
addGtu(Time time)
Add GTU to the current platoon.
|
Platoons |
addGtu(Time time,
Node origin,
Node destination,
Category category,
Speed speed)
Add GTU to the current platoon.
|
Platoons |
addPlatoon(Time start,
Time end)
Add a platoon.
|
Platoons |
fixInfo(Node origin,
Node destination,
Category category,
Speed speed)
Fix all info except time for GTU's added hereafter.
|
void |
start()
Starts the events.
|
public Platoons(LaneBasedGTUGenerator generator, LaneBasedGTUCharacteristicsGenerator characteristics, DEVSSimulatorInterface.TimeDoubleUnit simulator, Set<DirectedLanePosition> position)
generator
- LaneBasedGTUGenerator; GTU generatorcharacteristics
- LaneBasedGTUCharacteristicsGenerator; characteristics generatorsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; simulatorposition
- Set<DirectedLanePosition>; positionpublic Platoons(LaneBasedGTUGenerator generator, GTUCharacteristicsGeneratorOD characteristics, DEVSSimulatorInterface.TimeDoubleUnit simulator, StreamInterface stream, Set<DirectedLanePosition> position)
generator
- LaneBasedGTUGenerator; GTU generatorcharacteristics
- GTUCharacteristicsGeneratorOD; characteristics generatorsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; simulatorstream
- StreamInterface; random number streamposition
- Set<DirectedLanePosition>; positionpublic Platoons addPlatoon(Time start, Time end) throws SimRuntimeException
addGtu
.start
- Time; start timeend
- Time; end timeSimRuntimeException
- on exceptionpublic Platoons fixInfo(Node origin, Node destination, Category category, Speed speed)
origin
- Node; origindestination
- Node; destinationcategory
- Category; categoryspeed
- Speed; generation speedpublic Platoons addGtu(Time time)
fixInfo
.time
- Time; time of generationIllegalStateException
- if no fixed info was set using fixInfo
public Platoons addGtu(Time time, Node origin, Node destination, Category category, Speed speed)
time
- Time; time of generationorigin
- Node; origindestination
- Node; destinationcategory
- Category; categoryspeed
- Speed; generation speedIllegalStateException
- if no platoon was started or time is outside of the platoon time rangepublic void start() throws SimRuntimeException
SimRuntimeException
- if start of first platoon is in the pastCopyright © 2014–2018 Delft University of Technology. All rights reserved.