public class LaneBasedGTUGenerator extends Object implements Serializable, org.opentrafficsim.base.Identifiable, GTUGenerator
Copyright (c) 2013-2017 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 class |
LaneBasedGTUGenerator.Placement
Placement contains the information that a
RoomChecker returns. |
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
and position for the proposed new GTU.
|
| Constructor and Description |
|---|
LaneBasedGTUGenerator(String id,
org.opentrafficsim.core.distributions.Generator<org.djunits.value.vdouble.scalar.Duration> interarrivelTimeGenerator,
org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer,
LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator,
GeneratorPositions generatorPositions,
org.opentrafficsim.core.network.OTSNetwork network,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator,
LaneBasedGTUGenerator.RoomChecker roomChecker,
org.opentrafficsim.core.idgenerator.IdGenerator idGenerator)
Construct a new lane base GTU generator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disable(org.djunits.value.vdouble.scalar.Time start,
org.djunits.value.vdouble.scalar.Time end,
Set<LaneDirection> laneDirections)
Disable the vehicle generator during the specific time.
|
javax.media.j3d.Bounds |
getBounds() |
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.
|
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation() |
Map<nl.tudelft.simulation.language.d3.DirectedPoint,Integer> |
getQueueLengths()
Returns the number of vehicles in queue per included position for animation.
|
(package private) void |
placeGtu(LaneBasedGTUCharacteristics characteristics,
Set<DirectedLanePosition> position,
org.djunits.value.vdouble.scalar.Speed speed) |
void |
setGeneratedGTUs(long generatedGTUs) |
void |
setNoLaneChangeDistance(org.djunits.value.vdouble.scalar.Length noLaneChangeDistance)
Sets the initial distance over which lane changes shouldn't be performed.
|
String |
toString() |
public LaneBasedGTUGenerator(String id, org.opentrafficsim.core.distributions.Generator<org.djunits.value.vdouble.scalar.Duration> interarrivelTimeGenerator, org.opentrafficsim.core.gtu.animation.GTUColorer gtuColorer, LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator, GeneratorPositions generatorPositions, org.opentrafficsim.core.network.OTSNetwork network, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator, LaneBasedGTUGenerator.RoomChecker roomChecker, org.opentrafficsim.core.idgenerator.IdGenerator idGenerator) throws nl.tudelft.simulation.dsol.SimRuntimeException, org.opentrafficsim.core.distributions.ProbabilityException, org.opentrafficsim.base.parameters.ParameterException
id - String; name of the new GTU generatorinterarrivelTimeGenerator - Generator<Duration>; generator for the interval times between GTUsgtuColorer - GTUColorer; the GTU colorer that will be used by all generated GTUslaneBasedGTUCharacteristicsGenerator - LaneBasedGTUCharacteristicsGenerator; generator of the characteristics of
each GTUgeneratorPositions - GeneratorPositions; location and initial direction provider for all generated GTUsnetwork - OTSNetwork; the OTS network that owns the generated GTUssimulator - OTSDEVSSimulatorInterface; simulatorroomChecker - LaneBasedGTUGenerator.RoomChecker; the way that this generator checks that there is sufficient room to
place a new GTUidGenerator - IdGenerator; id generatornl.tudelft.simulation.dsol.SimRuntimeException - when startTime lies before the current simulation timeorg.opentrafficsim.core.distributions.ProbabilityException - peorg.opentrafficsim.base.parameters.ParameterException - if drawing from the interarrival generator failspublic void setNoLaneChangeDistance(org.djunits.value.vdouble.scalar.Length noLaneChangeDistance)
noLaneChangeDistance - Length; initial distance over which lane changes shouldn't be performedfinal void placeGtu(LaneBasedGTUCharacteristics characteristics, Set<DirectedLanePosition> position, org.djunits.value.vdouble.scalar.Speed speed) throws NamingException, org.opentrafficsim.core.gtu.GTUException, org.opentrafficsim.core.network.NetworkException, nl.tudelft.simulation.dsol.SimRuntimeException, org.opentrafficsim.core.geometry.OTSGeometryException
characteristics - LaneBasedGTUCharacteristics; characteristicsposition - Set<DirectedLanePosition>; positionspeed - Speed; speedNamingException - on exceptionorg.opentrafficsim.core.gtu.GTUException - on exceptionorg.opentrafficsim.core.network.NetworkException - on exceptionnl.tudelft.simulation.dsol.SimRuntimeException - on exceptionorg.opentrafficsim.core.geometry.OTSGeometryException - on exceptionpublic final long getGeneratedGTUs()
public final void setGeneratedGTUs(long generatedGTUs)
generatedGTUs - set generatedGTUs.public final String getId()
getId in interface org.opentrafficsim.base.Identifiablepublic final org.opentrafficsim.core.gtu.animation.GTUColorer getGtuColorer()
public void disable(org.djunits.value.vdouble.scalar.Time start,
org.djunits.value.vdouble.scalar.Time end,
Set<LaneDirection> laneDirections)
throws nl.tudelft.simulation.dsol.SimRuntimeException
start - Time; start timeend - Time; end timelaneDirections - Set<LaneDirection>; lanes to disable generation onnl.tudelft.simulation.dsol.SimRuntimeException - if time is incorrectpublic 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.