public abstract class AbstractSensor extends AbstractLaneBasedObject implements 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.
$LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $,
initial version Dec 31, 2014
SENSOR_TRIGGER_EVENT| Constructor and Description |
|---|
AbstractSensor(String id,
Lane lane,
org.djunits.value.vdouble.scalar.Length longitudinalPosition,
org.opentrafficsim.core.gtu.RelativePosition.TYPE positionType,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator) |
AbstractSensor(String id,
Lane lane,
org.djunits.value.vdouble.scalar.Length longitudinalPosition,
org.opentrafficsim.core.gtu.RelativePosition.TYPE positionType,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator,
org.opentrafficsim.core.geometry.OTSLine3D geometry)
Create a sensor on a lane at a position on that lane.
|
| Modifier and Type | Method and Description |
|---|---|
abstract AbstractSensor |
clone(CrossSectionElement newCSE,
org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator,
boolean animation)
Clone the LAneBasedObject for e.g., copying a network.
|
int |
compareTo(Sensor o) |
boolean |
equals(Object obj) |
org.opentrafficsim.core.gtu.RelativePosition.TYPE |
getPositionType() |
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface |
getSimulator() |
int |
hashCode() |
void |
trigger(LaneBasedGTU gtu)
Trigger an action on the GTU.
|
protected abstract void |
triggerResponse(LaneBasedGTU gtu)
Implementation of the response to a trigger of this sensor by a GTU.
|
clone, getLane, getLongitudinalPositiongetBounds, getGeometry, getHeight, getId, getLocation, toStringaddListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListenerclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBounds, getLane, getLocation, getLongitudinalPositionpublic AbstractSensor(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, org.opentrafficsim.core.gtu.RelativePosition.TYPE positionType, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator, org.opentrafficsim.core.geometry.OTSLine3D geometry) throws org.opentrafficsim.core.network.NetworkException
id - String; the id of the sensor.lane - Lane; the lane for which this is a sensor.longitudinalPosition - Length; the position (between 0.0 and the length of the Lane) of the sensor on the design
line of the lane.positionType - RelativePosition.TYPE; the relative position type (e.g., FRONT, BACK) of the vehicle that triggers
the sensor.simulator - OTSDEVSSimulatorInterface; the simulator (needed to generate the animation).geometry - the geometry of the object, which provides its location and bounds as wellorg.opentrafficsim.core.network.NetworkException - when the position on the lane is out of boundspublic AbstractSensor(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, org.opentrafficsim.core.gtu.RelativePosition.TYPE positionType, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator) throws org.opentrafficsim.core.network.NetworkException
id - String; the id of the sensor.lane - Lane; the lane for which this is a sensor.longitudinalPosition - Length; the position (between 0.0 and the length of the Lane) of the sensor on the design
line of the lane.positionType - RelativePosition.TYPE; the relative position type (e.g., FRONT, BACK) of the vehicle that triggers
the sensor.simulator - OTSDEVSSimulatorInterface; the simulator (needed to generate the animation).org.opentrafficsim.core.network.NetworkException - when the position on the lane is out of boundspublic final void trigger(LaneBasedGTU gtu)
sensor.trigger(this);.protected abstract void triggerResponse(LaneBasedGTU gtu)
gtu - LaneBasedGTU; the lane based GTU that triggered this sensor.public final org.opentrafficsim.core.gtu.RelativePosition.TYPE getPositionType()
getPositionType in interface Sensorpublic final org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface getSimulator()
getSimulator in interface Sensorpublic int compareTo(Sensor o)
compareTo in interface Comparable<Sensor>public abstract AbstractSensor clone(CrossSectionElement newCSE, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator, boolean animation) throws org.opentrafficsim.core.network.NetworkException
clone in class AbstractLaneBasedObjectnewCSE - the new cross section element to which the clone belongsnewSimulator - the new simulator for this networkanimation - whether to (re)create animation or notorg.opentrafficsim.core.network.NetworkException - in case the cloning failsCopyright © 2014–2016 Delft University of Technology. All rights reserved.