Class FlankSensor
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.opentrafficsim.core.object.StaticObject
-
- org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
-
- org.opentrafficsim.road.network.lane.object.sensor.AbstractSensor
-
- org.opentrafficsim.road.network.lane.object.trafficlight.FlankSensor
-
- All Implemented Interfaces:
Serializable
,Comparable<SingleSensor>
,Locatable
,EventProducerInterface
,org.opentrafficsim.base.Identifiable
,Drawable
,Compatible
,ObjectInterface
,LaneBasedObject
,Sensor
,SingleSensor
public class FlankSensor extends AbstractSensor
Embedded sensors used by a TrafficLightSensor.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Feb 28, 2019
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.djutils.event.EventProducer
eventProducerImpl
-
Fields inherited from interface org.opentrafficsim.core.compatibility.Compatible
EVERYTHING, MINUS, PLUS
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
Fields inherited from interface org.opentrafficsim.road.network.lane.object.sensor.SingleSensor
DEFAULT_SENSOR_ELEVATION, SENSOR_TRIGGER_EVENT
-
-
Constructor Summary
Constructors Constructor Description FlankSensor(String id, Lane lane, Length longitudinalPosition, RelativePosition.TYPE positionType, OTSSimulatorInterface simulator, TrafficLightSensor parent, Compatible compatible)
Construct a new FlankSensor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlankSensor
clone(CrossSectionElement newCSE, OTSSimulatorInterface newSimulator)
Clone the LaneBasedObject for e.g., copying a network.TrafficLightSensor
getParent()
Return the parent (TrafficLightSensor) of this FlankSensor.String
toString()
protected void
triggerResponse(LaneBasedGTU gtu)
Implementation of the response to a trigger of this sensor by a GTU.-
Methods inherited from class org.opentrafficsim.road.network.lane.object.sensor.AbstractSensor
compareTo, equals, getDetectedGTUTypes, getPositionType, getSimulator, hashCode, isCompatible, makeGeometry, trigger
-
Methods inherited from class org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition, init
-
Methods inherited from class org.opentrafficsim.core.object.StaticObject
create, create, getBounds, getGeometry, getHeight, getId, getSourceId
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, getSourceId, hasListeners, numberOfListeners, removeListener
-
Methods inherited from interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
getBounds, getDirection, getLane, getLocation, getLongitudinalPosition
-
Methods inherited from interface org.opentrafficsim.core.object.ObjectInterface
getFullId, getGeometry, getHeight
-
-
-
-
Constructor Detail
-
FlankSensor
public FlankSensor(String id, Lane lane, Length longitudinalPosition, RelativePosition.TYPE positionType, OTSSimulatorInterface simulator, TrafficLightSensor parent, Compatible compatible) throws NetworkException
Construct a new FlankSensor.- Parameters:
id
- String; the name of the new FlankSensorlane
- Lane; the lane of the new FlankSensorlongitudinalPosition
- Length; the longitudinal position of the new FlankSensorpositionType
- TYPE; the position on the GTUs that triggers the new FlankSensorsimulator
- OTSSimulatorInterface; the simulator engineparent
- TrafficLightSensor; the traffic light sensor that deploys this FlankSensorcompatible
- Compatible; object that determines if a GTU is detectable by the new FlankSensor- Throws:
NetworkException
- when the network is inconsistent
-
-
Method Detail
-
triggerResponse
protected final void triggerResponse(LaneBasedGTU gtu)
Implementation of the response to a trigger of this sensor by a GTU.- Specified by:
triggerResponse
in classAbstractSensor
- Parameters:
gtu
- LaneBasedGTU; the lane based GTU that triggered this sensor.
-
clone
public final FlankSensor clone(CrossSectionElement newCSE, OTSSimulatorInterface newSimulator) throws NetworkException
Clone the LaneBasedObject for e.g., copying a network.- Specified by:
clone
in classAbstractSensor
- Parameters:
newCSE
- CrossSectionElement; the new cross section element to which the clone belongsnewSimulator
- OTSSimulatorInterface; the new simulator for this network- Returns:
- AbstractLaneBasedObject; a clone of this object
- Throws:
NetworkException
- in case the cloning fails
-
getParent
public final TrafficLightSensor getParent()
Return the parent (TrafficLightSensor) of this FlankSensor.- Returns:
- TrafficLightSensor; the parent of this flank sensor
-
toString
public final String toString()
- Overrides:
toString
in classAbstractSensor
-
-