public class LaneBasedGTUGenerator extends nl.tudelft.simulation.event.EventProducer implements Serializable, Identifiable, GtuGeneratorQueue
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 | 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.
|
Modifier and Type | Field and Description |
---|---|
static nl.tudelft.simulation.event.EventType |
GTU_GENERATED_EVENT
Event of a generated GTU.
|
Constructor and Description |
---|
LaneBasedGTUGenerator(String id,
Generator<Duration> interarrivelTimeGenerator,
LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator,
GeneratorPositions generatorPositions,
OTSRoadNetwork network,
OTSSimulatorInterface simulator,
LaneBasedGTUGenerator.RoomChecker roomChecker,
IdGenerator idGenerator)
Construct a new lane base GTU generator.
|
Modifier and Type | Method and Description |
---|---|
void |
disable(Time start,
Time end,
Set<LaneDirection> laneDirections)
Disable the vehicle generator during the specific time.
|
javax.media.j3d.Bounds |
getBounds() |
long |
getGeneratedGTUs() |
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 locations and lengths of generation queues.
|
void |
placeGtu(LaneBasedGTUCharacteristics characteristics,
Set<DirectedLanePosition> position,
Speed speed)
Places a GTU, regardless of whether it has room.
|
void |
queueGtu(LaneBasedGTUCharacteristics characteristics,
Set<LaneDirection> position)
Adds a GTU to the generation queue.
|
void |
setErrorHandler(GTUErrorHandler gtuErrorHandler)
Sets the GTU error handler.
|
void |
setInstantaneousLaneChange(boolean instantaneous)
Sets whether GTUs will change lane instantaneously.
|
void |
setNoLaneChangeDistance(Length noLaneChangeDistance)
Sets the initial distance over which lane changes shouldn't be performed.
|
String |
toString() |
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
public static final nl.tudelft.simulation.event.EventType GTU_GENERATED_EVENT
public LaneBasedGTUGenerator(String id, Generator<Duration> interarrivelTimeGenerator, LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator, GeneratorPositions generatorPositions, OTSRoadNetwork network, OTSSimulatorInterface simulator, LaneBasedGTUGenerator.RoomChecker roomChecker, IdGenerator idGenerator) throws nl.tudelft.simulation.dsol.SimRuntimeException, ProbabilityException, ParameterException
id
- String; name of the new GTU generatorinterarrivelTimeGenerator
- Generator<Duration>; generator for the interval times between GTUslaneBasedGTUCharacteristicsGenerator
- LaneBasedGTUCharacteristicsGenerator; generator of the characteristics of
each GTUgeneratorPositions
- GeneratorPositions; location and initial direction provider for all generated GTUsnetwork
- OTSRoadNetwork; the OTS network that owns the generated GTUssimulator
- OTSSimulatorInterface; simulatorroomChecker
- 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 timeProbabilityException
- peParameterException
- if drawing from the interarrival generator failspublic void setNoLaneChangeDistance(Length noLaneChangeDistance)
noLaneChangeDistance
- Length; initial distance over which lane changes shouldn't be performedpublic void setInstantaneousLaneChange(boolean instantaneous)
instantaneous
- boolean; whether GTUs will change lane instantaneouslypublic void setErrorHandler(GTUErrorHandler gtuErrorHandler)
gtuErrorHandler
- GTUErrorHandler; GTU error handlerpublic final void queueGtu(LaneBasedGTUCharacteristics characteristics, Set<LaneDirection> position)
characteristics
- LaneBasedGTUCharacteristics; characteristics of GTU to add to the queueposition
- Set<LaneDirection>; position to generate the GTU atpublic final void placeGtu(LaneBasedGTUCharacteristics characteristics, Set<DirectedLanePosition> position, Speed speed) throws NamingException, GTUException, NetworkException, nl.tudelft.simulation.dsol.SimRuntimeException, OTSGeometryException
characteristics
- LaneBasedGTUCharacteristics; characteristicsposition
- Set<DirectedLanePosition>; positionspeed
- Speed; speedNamingException
- on exceptionGTUException
- on exceptionNetworkException
- on exceptionnl.tudelft.simulation.dsol.SimRuntimeException
- on exceptionOTSGeometryException
- on exceptionpublic final long getGeneratedGTUs()
public final String getId()
getId
in interface Identifiable
public void disable(Time start, 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.Locatable
RemoteException
public javax.media.j3d.Bounds getBounds() throws RemoteException
getBounds
in interface nl.tudelft.simulation.dsol.animation.Locatable
RemoteException
public Map<nl.tudelft.simulation.language.d3.DirectedPoint,Integer> getQueueLengths()
getQueueLengths
in interface GtuGeneratorQueue
Copyright © 2014–2019 Delft University of Technology. All rights reserved.