Class ReportingDetector
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.core.object.StaticObject
org.opentrafficsim.road.network.object.AbstractLaneBasedObject
org.opentrafficsim.road.network.object.detector.LaneDetector
org.opentrafficsim.road.network.object.detector.ReportingDetector
- All Implemented Interfaces:
Comparable<LaneDetector>,nl.tudelft.simulation.dsol.animation.Locatable,Identifiable,EventProducer,OtsShape,HierarchicallyTyped<DetectorType,,Detector> Detector,LocatedObject,LaneBasedObject
Detector that prints which GTU triggers it.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Field Summary
Fields inherited from class org.opentrafficsim.road.network.object.detector.LaneDetector
DEFAULT_DETECTOR_ELEVATION, DETECTOR_TRIGGER_EVENTFields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITIONFields inherited from interface org.opentrafficsim.base.geometry.OtsShape
DEFAULT_POLYGON_SEGMENTS, WORLD_MARGIN_LINE -
Constructor Summary
ConstructorsConstructorDescriptionReportingDetector(String id, Lane lane, org.djunits.value.vdouble.scalar.Length position, RelativePosition.Type triggerPosition, DetectorType detectorType) Construct a new ReportingDetector. -
Method Summary
Methods inherited from class org.opentrafficsim.road.network.object.detector.LaneDetector
compareTo, equals, getPositionType, getType, hashCode, isCompatible, triggerMethods inherited from class org.opentrafficsim.road.network.object.AbstractLaneBasedObject
getFullId, getLane, getLine, getLongitudinalPosition, initMethods inherited from class org.opentrafficsim.core.object.StaticObject
create, create, getAbsoluteContour, getHeight, getId, getLocation, getRelativeBounds, getRelativeContourMethods inherited from class org.djutils.event.LocalEventProducer
getEventListenerMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from interface org.opentrafficsim.base.HierarchicallyTyped
isOfTypeMethods inherited from interface org.djutils.base.Identifiable
getIdMethods inherited from interface org.opentrafficsim.road.network.object.LaneBasedObject
getLane, getLength, getLine, getLocation, getLongitudinalPosition, getSimulatorMethods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getZMethods inherited from interface org.opentrafficsim.core.object.LocatedObject
getFullId, getHeightMethods inherited from interface org.opentrafficsim.base.geometry.OtsShape
contains, contains, getAbsoluteBounds, getAbsoluteContour, getAbsoluteContour, getDirZ, getRelativeBounds, getRelativeContour, signedDistance, signedDistance
-
Constructor Details
-
ReportingDetector
public ReportingDetector(String id, Lane lane, org.djunits.value.vdouble.scalar.Length position, RelativePosition.Type triggerPosition, DetectorType detectorType) throws NetworkException Construct a new ReportingDetector.- Parameters:
lane- the lane on which the new ReportingDetector will be locatedposition- the position of the detector along the lanetriggerPosition- RelativePosition.TYPE; the relative position type (e.g., FRONT, BACK) of the vehicle that triggers the detectorid- the id of the new ReportingDetectordetectorType- detector type.- Throws:
NetworkException- when the position on the lane is out of bounds w.r.t. the center line of the lane
-
-
Method Details
-
triggerResponse
Description copied from class:LaneDetectorImplementation of the response to a trigger of this detector by a GTU.- Specified by:
triggerResponsein classLaneDetector- Parameters:
gtu- the lane based GTU that triggered this detector.
-
toString
- Overrides:
toStringin classLaneDetector
-