Interface SingleSensor
-
- All Superinterfaces:
Comparable<SingleSensor>
,Compatible
,EventProducerInterface
,org.opentrafficsim.base.Identifiable
,LaneBasedObject
,Locatable
,ObjectInterface
,Sensor
,Serializable
- All Known Implementing Classes:
AbstractSensor
,DestinationSensor
,Detector
,FlankSensor
,SimpleReportingSensor
,SinkSensor
public interface SingleSensor extends Sensor, Comparable<SingleSensor>, LaneBasedObject, Compatible
A sensor is a lane-based object that can be triggered by a relative position of the GTU (e.g., front, back) when that relative position passes over the sensor location on the lane.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.$LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $, initial version Dec 31, 2014
- Author:
- Alexander Verbraeck, Peter Knoppers
-
-
Field Summary
Fields Modifier and Type Field Description static Length
DEFAULT_SENSOR_ELEVATION
Default elevation of a sensor; if the lane is not at elevation 0; this value is probably far off.static TimedEventType
SENSOR_TRIGGER_EVENT
The timed event type for pub/sub indicating the triggering of a Sensor on a lane.-
Fields inherited from interface org.opentrafficsim.core.compatibility.Compatible
EVERYTHING, MINUS, PLUS
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RelativePosition.TYPE
getPositionType()
OTSSimulatorInterface
getSimulator()
void
trigger(LaneBasedGTU gtu)
Trigger an action on the GTU.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.opentrafficsim.core.compatibility.Compatible
isCompatible
-
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
-
-
-
-
Field Detail
-
SENSOR_TRIGGER_EVENT
static final TimedEventType SENSOR_TRIGGER_EVENT
The timed event type for pub/sub indicating the triggering of a Sensor on a lane.
Payload: Object[] {String sensorId, Sensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE relativePosition}
-
DEFAULT_SENSOR_ELEVATION
static final Length DEFAULT_SENSOR_ELEVATION
Default elevation of a sensor; if the lane is not at elevation 0; this value is probably far off.
-
-
Method Detail
-
getPositionType
RelativePosition.TYPE getPositionType()
- Returns:
- the relative position type of the vehicle (e.g., FRONT, BACK) that triggers the sensor.
-
trigger
void trigger(LaneBasedGTU gtu)
Trigger an action on the GTU. Normally this is the GTU that triggered the sensor. The typical call therefore issensor.trigger(this);
.- Parameters:
gtu
- LaneBasedGTU; the GTU for which to carry out the trigger action.
-
getSimulator
OTSSimulatorInterface getSimulator()
- Returns:
- The simulator.
-
-