public class SimpleReportingSensor extends AbstractSensor
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-08-12 16:37:45 +0200 (Wed, 12 Aug 2015) $, @version $Revision: 1240 $, by $Author: averbraeck $,
initial version an 30, 2015
listenersDEFAULT_SENSOR_ELEVATION, SENSOR_TRIGGER_EVENTFIRST_POSITION, LAST_POSITIONEVERYTHING| Constructor and Description |
|---|
SimpleReportingSensor(String id,
Lane lane,
Length position,
RelativePosition.TYPE triggerPosition,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
Compatible compatible)
Construct a new SimpleReportingSensor.
|
| Modifier and Type | Method and Description |
|---|---|
SimpleReportingSensor |
clone(CrossSectionElement newCSE,
SimulatorInterface.TimeDoubleUnit newSimulator,
boolean animation)
Clone the LaneBasedObject for e.g., copying a network.
|
String |
toString() |
void |
triggerResponse(LaneBasedGTU gtu)
Implementation of the response to a trigger of this sensor by a GTU.
|
compareTo, equals, getDetectedGTUTypes, getPositionType, getSimulator, hashCode, isCompatible, triggerclone, getDirection, getFullId, getLane, getLocation, getLongitudinalPositiongetBounds, getGeometry, getHeight, getIdaddListener, 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, getLongitudinalPositiongetFullId, getGeometry, getHeightgetIdaddListener, addListener, addListener, addListener, removeListenerpublic SimpleReportingSensor(String id, Lane lane, Length position, RelativePosition.TYPE triggerPosition, DEVSSimulatorInterface.TimeDoubleUnit simulator, Compatible compatible) throws NetworkException
lane - Lane; the lane on which the new SimpleReportingSensor will be locatedposition - Length; the position of the sensor along the lanetriggerPosition - RelativePosition.TYPE; the relative position type (e.g., FRONT, BACK) of the vehicle that triggers
the sensorid - String; the id of the new SimpleReportingSensorsimulator - DEVSSimulatorInterface.TimeDoubleUnit; the simulator to enable animationcompatible - Compatible; object that can decide if a particular GTU type in a particular driving direction will
trigger the new SimpleReportingSensorNetworkException - when the position on the lane is out of bounds w.r.t. the center line of the lanepublic final void triggerResponse(LaneBasedGTU gtu)
triggerResponse in class AbstractSensorgtu - LaneBasedGTU; the lane based GTU that triggered this sensor.public SimpleReportingSensor clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation) throws NetworkException
clone in class AbstractSensornewCSE - CrossSectionElement; the new cross section element to which the clone belongsnewSimulator - SimulatorInterface.TimeDoubleUnit; the new simulator for this networkanimation - boolean; whether to (re)create animation or notNetworkException - in case the cloning failspublic final String toString()
toString in class AbstractSensorCopyright © 2014–2018 Delft University of Technology. All rights reserved.