public abstract class AbstractSensor extends AbstractLaneBasedObject implements SingleSensor
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
| Modifier and Type | Field and Description |
|---|---|
protected static ImmutableSet<org.opentrafficsim.core.gtu.GTUType> |
GTUTYPE_SET_ALL
The immutable set for all gtu type.
|
DEFAULT_SENSOR_ELEVATION, 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 at specified elevation and triggering an all GTU types.
|
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,
ImmutableSet<org.opentrafficsim.core.gtu.GTUType> triggeringGTUTypes)
Create a sensor on a lane at a position on that lane at elevation
Sensor.DEFAULT_SENSOR_ELEVATION. |
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,
org.djunits.value.vdouble.scalar.Length elevation)
Create a sensor on a lane at a position on that lane at specified elevation and triggering an all GTU types.
|
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,
org.djunits.value.vdouble.scalar.Length elevation,
ImmutableSet<org.opentrafficsim.core.gtu.GTUType> triggeringGTUTypes)
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(SingleSensor o) |
boolean |
equals(Object obj) |
org.opentrafficsim.core.gtu.RelativePosition.TYPE |
getPositionType() |
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface |
getSimulator() |
ImmutableSet<org.opentrafficsim.core.gtu.GTUType> |
getTriggeringGTUTypes()
Return which GTU types will trigger this particular sensor.
|
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, getDirection, getLane, getLocation, getLongitudinalPositiongetBounds, getGeometry, getHeight, getId, 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, getDirection, getLane, getLocation, getLongitudinalPositionprotected static final ImmutableSet<org.opentrafficsim.core.gtu.GTUType> GTUTYPE_SET_ALL
public 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, org.djunits.value.vdouble.scalar.Length elevation, ImmutableSet<org.opentrafficsim.core.gtu.GTUType> triggeringGTUTypes) 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 - OTSLine3D; the geometry of the object, which provides its location and bounds as wellelevation - Length; elevation of the sensortriggeringGTUTypes - ImmutableSet<GTUType>; The GTU types will trigger this particular sensororg.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, org.opentrafficsim.core.geometry.OTSLine3D geometry, ImmutableSet<org.opentrafficsim.core.gtu.GTUType> triggeringGTUTypes) throws org.opentrafficsim.core.network.NetworkException
Sensor.DEFAULT_SENSOR_ELEVATION.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 - OTSLine3D; the geometry of the object, which provides its location and bounds as welltriggeringGTUTypes - ImmutableSet<GTUType>; The GTU types will trigger this particular sensororg.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, org.opentrafficsim.core.geometry.OTSLine3D geometry, org.djunits.value.vdouble.scalar.Length elevation) 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 - OTSLine3D; the geometry of the object, which provides its location and bounds as wellelevation - Length; elevation of the sensororg.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, 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 - OTSLine3D; 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);.trigger in interface SingleSensorgtu - the GTU for which to carry out the trigger action.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 SingleSensorpublic final org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface getSimulator()
getSimulator in interface SingleSensorpublic final ImmutableSet<org.opentrafficsim.core.gtu.GTUType> getTriggeringGTUTypes()
getTriggeringGTUTypes in interface SingleSensorpublic int compareTo(SingleSensor o)
compareTo in interface Comparable<SingleSensor>public abstract AbstractSensor clone(CrossSectionElement newCSE, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator, boolean animation) throws org.opentrafficsim.core.network.NetworkException
clone in class AbstractLaneBasedObjectnewCSE - CrossSectionElement; the new cross section element to which the clone belongsnewSimulator - OTSSimulatorInterface; the new simulator for this networkanimation - boolean; whether to (re)create animation or notorg.opentrafficsim.core.network.NetworkException - in case the cloning failsCopyright © 2014–2017 Delft University of Technology. All rights reserved.