public class LaneBasedGTUGenerator extends Object implements Serializable
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Class and Description |
|---|---|
static interface |
LaneBasedGTUGenerator.RoomChecker
Interface for class that checks that there is sufficient room for a proposed new GTU and returns the maximum safe speed
for the proposed new GTU.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) org.opentrafficsim.core.gtu.animation.GTUColorer |
gtuColorer
The GTU colorer that will be linked to each generated GTU.
|
(package private) Set<DirectedLanePosition> |
initialLongitudinalPositions
The location and initial direction of the generated GTUs.
|
(package private) org.djunits.value.vdouble.scalar.Duration |
reTryInterval
Retry interval for checking if a GTU can be placed.
|
(package private) LaneBasedGTUGenerator.RoomChecker |
roomChecker
The way that this generator checks if it is safe to construct and place the next lane based GTU.
|
| Constructor and Description |
|---|
LaneBasedGTUGenerator(String id,
org.opentrafficsim.core.distributions.Generator<org.djunits.value.vdouble.scalar.Duration> interarrivelTimeGenerator,
long maxGTUs,
org.djunits.value.vdouble.scalar.Time startTime,
org.djunits.value.vdouble.scalar.Time endTime,
org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer,
LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator,
Set<DirectedLanePosition> initialLongitudinalPositions,
org.opentrafficsim.core.network.OTSNetwork network,
LaneBasedGTUGenerator.RoomChecker roomChecker)
Construct a new lane base GTU generator.
|
| Modifier and Type | Method and Description |
|---|---|
org.djunits.value.vdouble.scalar.Time |
getEndTime()
Retrieve the end time of this LaneBasedGTUGenerator.
|
long |
getGeneratedGTUs() |
org.opentrafficsim.core.gtu.animation.GTUColorer |
getGtuColorer()
Retrieve the GTUColorer that this LaneBasedGTUGenerator assigns to all generated GTUs.
|
String |
getId()
Retrieve the id of this LaneBasedGTUGenerator.
|
long |
getMaxGTUs()
Retrieve the maximum number of GTUs to generate.
|
void |
setGeneratedGTUs(long generatedGTUs) |
String |
toString() |
org.djunits.value.vdouble.scalar.Duration reTryInterval
final Set<DirectedLanePosition> initialLongitudinalPositions
final LaneBasedGTUGenerator.RoomChecker roomChecker
final org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer
public LaneBasedGTUGenerator(String id, org.opentrafficsim.core.distributions.Generator<org.djunits.value.vdouble.scalar.Duration> interarrivelTimeGenerator, long maxGTUs, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime, org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer, LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator, Set<DirectedLanePosition> initialLongitudinalPositions, org.opentrafficsim.core.network.OTSNetwork network, LaneBasedGTUGenerator.RoomChecker roomChecker) throws nl.tudelft.simulation.dsol.SimRuntimeException, org.opentrafficsim.core.distributions.ProbabilityException, org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException
id - String; name of the new GTU generatorinterarrivelTimeGenerator - Generator<Duration>; generator for the interval times between GTUsmaxGTUs - long; maximum number of GTUs to generatestartTime - Time; time at which the first GTU will be generatedendTime - Time; time after which no more GTUs will be generatedgtuColorer - GTUColorer; the GTU colorer that will be used by all generated GTUslaneBasedGTUCharacteristicsGenerator - LaneBasedGTUCharacteristicsGenerator; generator of the characteristics of
each GTUinitialLongitudinalPositions - SET<DirectedLanePosition>; the location and initial direction of all generated
GTUsnetwork - OTSNetwork; the OTS network that owns the generated GTUsroomChecker - LaneBasedGTUGenerator.RoomChecker; the way that this generator checks that there is sufficient room to
place a new GTUnl.tudelft.simulation.dsol.SimRuntimeException - when startTime lies before the current simulation timeorg.opentrafficsim.core.distributions.ProbabilityException - peorg.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException - if drawing from the interarrival generator failspublic long getGeneratedGTUs()
public void setGeneratedGTUs(long generatedGTUs)
generatedGTUs - set generatedGTUs.public String getId()
public org.djunits.value.vdouble.scalar.Time getEndTime()
public long getMaxGTUs()
public org.opentrafficsim.core.gtu.animation.GTUColorer getGtuColorer()
Copyright © 2014–2016 Delft University of Technology. All rights reserved.