public class LaneBasedGTUGenerator extends Object implements Serializable, Identifiable, GTUGenerator
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.
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,
Generator<Duration> interarrivelTimeGenerator,
GTUColorer gtuColorer,
LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator,
GeneratorPositions generatorPositions,
OTSNetwork network,
DEVSSimulatorInterface.TimeDoubleUnit 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() |
GTUColorer |
getGtuColorer()
Retrieve the GTUColorer that this LaneBasedGTUGenerator assigns to all generated GTUs.
|
String |
getId()
Retrieve the id of this LaneBasedGTUGenerator.
|
DirectedPoint |
getLocation() |
Map<DirectedPoint,Integer> |
getQueueLengths()
Returns the number of vehicles in queue per included position for animation.
|
void |
setGeneratedGTUs(long generatedGTUs) |
void |
setNoLaneChangeDistance(Length noLaneChangeDistance)
Sets the initial distance over which lane changes shouldn't be performed.
|
String |
toString() |
public LaneBasedGTUGenerator(String id, Generator<Duration> interarrivelTimeGenerator, GTUColorer gtuColorer, LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator, GeneratorPositions generatorPositions, OTSNetwork network, DEVSSimulatorInterface.TimeDoubleUnit simulator, LaneBasedGTUGenerator.RoomChecker roomChecker, IdGenerator idGenerator) throws SimRuntimeException, ProbabilityException, 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
- DEVSSimulatorInterface.TimeDoubleUnit; simulatorroomChecker
- LaneBasedGTUGenerator.RoomChecker; the way that this generator checks that there is sufficient room to
place a new GTUidGenerator
- IdGenerator; id generatorSimRuntimeException
- 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 final long getGeneratedGTUs()
public final void setGeneratedGTUs(long generatedGTUs)
generatedGTUs
- set generatedGTUs.public final String getId()
getId
in interface Identifiable
public final GTUColorer getGtuColorer()
public void disable(Time start, Time end, Set<LaneDirection> laneDirections) throws SimRuntimeException
start
- Time; start timeend
- Time; end timelaneDirections
- Set<LaneDirection>; lanes to disable generation onSimRuntimeException
- if time is incorrectpublic DirectedPoint getLocation() throws RemoteException
getLocation
in interface Locatable
RemoteException
public javax.media.j3d.Bounds getBounds() throws RemoteException
getBounds
in interface Locatable
RemoteException
public Map<DirectedPoint,Integer> getQueueLengths()
getQueueLengths
in interface GTUGenerator
Copyright © 2014–2018 Delft University of Technology. All rights reserved.