public class TrafficLightSensor extends nl.tudelft.simulation.event.EventProducer implements nl.tudelft.simulation.event.EventListenerInterface, NonDirectionalOccupancySensor, nl.tudelft.simulation.event.EventProducerInterface
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.
| Modifier and Type | Field and Description |
|---|---|
(package private) String |
id
Id of this TrafficLightSensor.
|
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) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGTU(LaneBasedGTU gtu)
Add a GTU to the set.
|
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.
|
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, removeListenerfinal String id
public 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 NonDirectionalOccupancySensorCopyright © 2014–2016 Delft University of Technology. All rights reserved.