public class TrafficLightSensor extends nl.tudelft.simulation.event.EventProducer implements nl.tudelft.simulation.event.EventListenerInterface, NonDirectionalOccupancySensor, nl.tudelft.simulation.event.EventProducerInterface, Locatable, Sensor
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.
NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_ENTRY_EVENT, NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_EXIT_EVENT| Constructor and Description |
|---|
TrafficLightSensor(String id,
Lane laneA,
org.djunits.value.vdouble.scalar.Length positionA,
Lane laneB,
org.djunits.value.vdouble.scalar.Length positionB,
List<Lane> intermediateLanes,
org.opentrafficsim.core.gtu.RelativePosition.TYPE entryPosition,
org.opentrafficsim.core.gtu.RelativePosition.TYPE exitPosition,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator)
Construct a new traffic light sensor.
TODO Possibly provide the GTUTypes that trigger the sensor as an argument for the constructor |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGTU(LaneBasedGTU gtu)
Add a GTU to the set.
|
Bounds |
getBounds() |
String |
getId() |
org.djunits.value.vdouble.scalar.Length |
getLanePositionA()
Return the A position of this NonDirectionalOccupancySensor.
|
org.djunits.value.vdouble.scalar.Length |
getLanePositionB()
Return the B position of this NonDirectionalOccupancySensor.
|
DirectedPoint |
getLocation() |
boolean |
getOccupancy()
Return the state of this traffic light sensor.
|
org.opentrafficsim.core.geometry.OTSLine3D |
getPath()
Return the path of this traffic light sensor.
|
org.opentrafficsim.core.gtu.RelativePosition.TYPE |
getPositionTypeEntry() |
org.opentrafficsim.core.gtu.RelativePosition.TYPE |
getPositionTypeExit() |
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface |
getSimulator() |
void |
notify(nl.tudelft.simulation.event.EventInterface event) |
protected void |
removeGTU(LaneBasedGTU gtu)
Remove a GTU from the set.
|
(package private) void |
signalDetection(FlankSensor sensor,
LaneBasedGTU gtu)
One of our flank sensors has triggered.
|
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListenerpublic TrafficLightSensor(String id, Lane laneA, org.djunits.value.vdouble.scalar.Length positionA, Lane laneB, org.djunits.value.vdouble.scalar.Length positionB, List<Lane> intermediateLanes, org.opentrafficsim.core.gtu.RelativePosition.TYPE entryPosition, org.opentrafficsim.core.gtu.RelativePosition.TYPE exitPosition, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator) throws org.opentrafficsim.core.network.NetworkException
id - String; id of this sensorlaneA - Lane; the lane of the A detection point of this traffic light sensorpositionA - Length; the position of the A detection point of this traffic light sensorlaneB - Lane; the lane of the B detection point of this traffic light sensorpositionB - Length; the position of the B detection point of this traffic light sensorintermediateLanes - List<Lane>; list of intermediate lanesentryPosition - RelativePosition; the position on the GTUs that trigger the entry eventsexitPosition - RelativePosition; the position on the GTUs that trigger the exit eventssimulator - OTSDEVSSimulatorInterface; the simulatororg.opentrafficsim.core.network.NetworkException - when the network is inconsistent.protected final void addGTU(LaneBasedGTU gtu)
gtu - LaneBasedGTU; the GTU that must be addedprotected final void removeGTU(LaneBasedGTU gtu)
gtu - LaneBasedGTU; the GTU that must be removedpublic final void notify(nl.tudelft.simulation.event.EventInterface event)
throws RemoteException
notify in interface nl.tudelft.simulation.event.EventListenerInterfaceRemoteExceptionpublic final org.opentrafficsim.core.gtu.RelativePosition.TYPE getPositionTypeEntry()
getPositionTypeEntry in interface NonDirectionalOccupancySensorpublic final org.opentrafficsim.core.gtu.RelativePosition.TYPE getPositionTypeExit()
getPositionTypeExit in interface NonDirectionalOccupancySensorpublic final org.djunits.value.vdouble.scalar.Length getLanePositionA()
getLanePositionA in interface NonDirectionalOccupancySensorpublic final org.djunits.value.vdouble.scalar.Length getLanePositionB()
getLanePositionB in interface NonDirectionalOccupancySensorfinal void signalDetection(FlankSensor sensor, LaneBasedGTU gtu)
sensor - FlankSensor; the sensor that was triggeredgtu - LaneBasedGTU; the gtu that triggered the flank sensorpublic final String getId()
getId in interface NonDirectionalOccupancySensorpublic final org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface getSimulator()
getSimulator in interface NonDirectionalOccupancySensorpublic final DirectedPoint getLocation() throws RemoteException
getLocation in interface LocatableRemoteExceptionpublic final Bounds getBounds() throws RemoteException
getBounds in interface LocatableRemoteExceptionpublic final org.opentrafficsim.core.geometry.OTSLine3D getPath()
public final boolean getOccupancy()
Copyright © 2014–2016 Delft University of Technology. All rights reserved.