public class FlankSensor extends AbstractSensor
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.
listeners
DEFAULT_SENSOR_ELEVATION, SENSOR_TRIGGER_EVENT
FIRST_POSITION, LAST_POSITION
EVERYTHING
Constructor and Description |
---|
FlankSensor(String id,
Lane lane,
Length longitudinalPosition,
RelativePosition.TYPE positionType,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
TrafficLightSensor parent,
Compatible compatible)
Construct a new FlankSensor.
|
Modifier and Type | Method and Description |
---|---|
FlankSensor |
clone(CrossSectionElement newCSE,
SimulatorInterface.TimeDoubleUnit 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.
|
compareTo, equals, getDetectedGTUTypes, getPositionType, getSimulator, hashCode, isCompatible, trigger
clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition
getBounds, getGeometry, getHeight, getId
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBounds, getDirection, getLane, getLocation, getLongitudinalPosition
getFullId, getGeometry, getHeight
getId
addListener, addListener, addListener, addListener, removeListener
public FlankSensor(String id, Lane lane, Length longitudinalPosition, RelativePosition.TYPE positionType, DEVSSimulatorInterface.TimeDoubleUnit simulator, TrafficLightSensor parent, Compatible compatible) throws NetworkException
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
- DEVSSimulatorInterface.TimeDoubleUnit; the simulator engineparent
- TrafficLightSensor; the traffic light sensor that deploys this FlankSensorcompatible
- Compatible; object that determines if a GTU is detectable by the new FlankSensorNetworkException
- when the network is inconsistentprotected final void triggerResponse(LaneBasedGTU gtu)
triggerResponse
in class AbstractSensor
gtu
- LaneBasedGTU; the lane based GTU that triggered this sensor.public final FlankSensor clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
clone
in class AbstractSensor
newCSE
- CrossSectionElement; the new cross section element to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkNetworkException
- in case the cloning failspublic final TrafficLightSensor getParent()
public final String toString()
toString
in class AbstractSensor
Copyright © 2014–2019 Delft University of Technology. All rights reserved.