Class AbstractSensor

All Implemented Interfaces:
Serializable, Comparable<SingleSensor>, Locatable, EventProducerInterface, Identifiable, Drawable, Compatible, ObjectInterface, LaneBasedObject, Sensor, SingleSensor
Direct Known Subclasses:
Detector, FlankSensor, SimpleReportingSensor, SinkSensor

public abstract class AbstractSensor
extends AbstractLaneBasedObject
implements SingleSensor

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.

$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
See Also:
Serialized Form
  • Constructor Details

    • AbstractSensor

      public AbstractSensor​(String id, Lane lane, Length longitudinalPosition, RelativePosition.TYPE positionType, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSLine3D geometry, Length elevation, Compatible detectedGTUTypes) throws NetworkException
      Create a sensor on a lane at a position on that lane.
      Parameters:
      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 - DEVSSimulatorInterface.TimeDoubleUnit; the simulator (needed to generate the animation).
      geometry - OTSLine3D; the geometry of the object, which provides its location and bounds as well
      elevation - Length; elevation of the sensor
      detectedGTUTypes - Compatible; The GTU types will trigger this sensor
      Throws:
      NetworkException - when the position on the lane is out of bounds
    • AbstractSensor

      public AbstractSensor​(String id, Lane lane, Length longitudinalPosition, RelativePosition.TYPE positionType, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSLine3D geometry, Compatible detectedGTUTypes) throws NetworkException
      Create a sensor on a lane at a position on that lane at elevation Sensor.DEFAULT_SENSOR_ELEVATION.
      Parameters:
      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 - DEVSSimulatorInterface.TimeDoubleUnit; the simulator (needed to generate the animation).
      geometry - OTSLine3D; the geometry of the object, which provides its location and bounds as well
      detectedGTUTypes - Compatible; The GTU types will trigger this sensor
      Throws:
      NetworkException - when the position on the lane is out of bounds
    • AbstractSensor

      public AbstractSensor​(String id, Lane lane, Length longitudinalPosition, RelativePosition.TYPE positionType, DEVSSimulatorInterface.TimeDoubleUnit simulator, Compatible detectedGTUTypes) throws NetworkException
      Create a new AbstractSensor on a lane at a position on that lane at elevation Sensor.DEFAULT_SENSOR_ELEVATION and default geometry.
      Parameters:
      id - String; the id of the new AbstractSensor
      lane - Lane; the lane on which the new AbstractSensor is positioned
      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 - DEVSSimulatorInterface.TimeDoubleUnit; the simulator (needed to generate the animation).
      detectedGTUTypes - Compatible; The GTU types will trigger this sensor
      Throws:
      NetworkException - when the position on the lane is out of bounds
  • Method Details