Class ReportingDetector

All Implemented Interfaces:
Comparable<LaneDetector>, nl.tudelft.simulation.dsol.animation.Locatable, Identifiable, EventProducer, OtsShape, HierarchicallyTyped<DetectorType,Detector>, Detector, LocatedObject, LaneBasedObject

public class ReportingDetector extends LaneDetector
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
  • 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 located
      position - the position of the detector along the lane
      triggerPosition - RelativePosition.TYPE; the relative position type (e.g., FRONT, BACK) of the vehicle that triggers the detector
      id - the id of the new ReportingDetector
      detectorType - 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

      public final void triggerResponse(LaneBasedGtu gtu)
      Description copied from class: LaneDetector
      Implementation of the response to a trigger of this detector by a GTU.
      Specified by:
      triggerResponse in class LaneDetector
      Parameters:
      gtu - the lane based GTU that triggered this detector.
    • toString

      public final String toString()
      Overrides:
      toString in class LaneDetector