public class LaneBasedGTUGenerator extends EventProducer implements Serializable, Identifiable, GTUGenerator
 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 EventType | 
GTU_GENERATED_EVENT
Event of a generated GTU. 
 | 
listenersFIRST_POSITION, LAST_POSITION| Constructor and Description | 
|---|
LaneBasedGTUGenerator(String id,
                     Generator<Duration> interarrivelTimeGenerator,
                     LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator,
                     GeneratorPositions generatorPositions,
                     OTSNetwork 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. 
 | 
DirectedPoint | 
getLocation() | 
Map<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 | 
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, removeListenerpublic static final EventType GTU_GENERATED_EVENT
public LaneBasedGTUGenerator(String id, Generator<Duration> interarrivelTimeGenerator, LaneBasedGTUCharacteristicsGenerator laneBasedGTUCharacteristicsGenerator, GeneratorPositions generatorPositions, OTSNetwork network, OTSSimulatorInterface 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 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 - OTSSimulatorInterface; simulatorroomChecker - 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 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, SimRuntimeException, OTSGeometryException
characteristics - LaneBasedGTUCharacteristics; characteristicsposition - Set<DirectedLanePosition>; positionspeed - Speed; speedNamingException - on exceptionGTUException - on exceptionNetworkException - on exceptionSimRuntimeException - on exceptionOTSGeometryException - on exceptionpublic final long getGeneratedGTUs()
public final String getId()
getId in interface Identifiablepublic 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 LocatableRemoteExceptionpublic javax.media.j3d.Bounds getBounds()
                                 throws RemoteException
getBounds in interface LocatableRemoteExceptionpublic Map<DirectedPoint,Integer> getQueueLengths()
getQueueLengths in interface GTUGeneratorCopyright © 2014–2019 Delft University of Technology. All rights reserved.