Class Detector.PlatoonSizes

java.lang.Object
org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonSizes
All Implemented Interfaces:
Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
Enclosing class:
Detector

public static class Detector.PlatoonSizes
extends Object
implements Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
Measurement of platoon sizes based on time between previous GTU exit and GTU entry.

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 15 mrt. 2018
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Summary

    Constructors 
    Constructor Description
    PlatoonSizes​(Duration threshold)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement accumulateEntry​(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, LaneBasedGTU gtu, Detector loopDetector)
    Returns an accumulated value for when the front reaches the detector.
    org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement accumulateExit​(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, LaneBasedGTU gtu, Detector loopDetector)
    Returns an accumulated value for when the rear leaves the detector.
    List<Integer> aggregate​(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, int count, Duration aggregation)
    Returns an aggregated value.
    String getName()
    Returns the value name.
    org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement identity()
    Returns the initial value before accumulation.
    boolean isPeriodic()
    Returns whether the measurement aggregates every aggregation period (or only over the entire simulation).
    String stringValue​(List<Integer> aggregate, String format)
    Returns a string representation of the aggregate result.
    String toString()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PlatoonSizes

      public PlatoonSizes​(Duration threshold)
      Constructor.
      Parameters:
      threshold - Duration; maximum time between two vehicles that are considered to be in the same platoon
  • Method Details

    • identity

      public org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement identity()
      Returns the initial value before accumulation.
      Specified by:
      identity in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Returns:
      C; initial value before accumulation
    • accumulateEntry

      public org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement accumulateEntry​(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, LaneBasedGTU gtu, Detector loopDetector)
      Returns an accumulated value for when the front reaches the detector.
      Specified by:
      accumulateEntry in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Parameters:
      cumulative - C; accumulated value
      gtu - LaneBasedGTU; gtu
      loopDetector - Detector; loop detector
      Returns:
      C; accumulated value
    • accumulateExit

      public org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement accumulateExit​(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, LaneBasedGTU gtu, Detector loopDetector)
      Returns an accumulated value for when the rear leaves the detector. GTU's may trigger an exit without having triggered an entry due to a lane change. Reversely, GTU's may not trigger an exit while they did trigger an entry.
      Specified by:
      accumulateExit in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Parameters:
      cumulative - C; accumulated value
      gtu - LaneBasedGTU; gtu
      loopDetector - Detector; loop detector
      Returns:
      C; accumulated value
    • isPeriodic

      public boolean isPeriodic()
      Returns whether the measurement aggregates every aggregation period (or only over the entire simulation).
      Specified by:
      isPeriodic in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Returns:
      boolean; whether the measurement aggregates every aggregation period (or only over the entire simulation)
    • aggregate

      public List<Integer> aggregate​(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, int count, Duration aggregation)
      Returns an aggregated value.
      Specified by:
      aggregate in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Parameters:
      cumulative - C; accumulated value
      count - int; GTU count
      aggregation - Duration; aggregation period
      Returns:
      A; aggregated value
    • getName

      public String getName()
      Returns the value name.
      Specified by:
      getName in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Returns:
      String; value name
    • stringValue

      public String stringValue​(List<Integer> aggregate, String format)
      Returns a string representation of the aggregate result.
      Specified by:
      stringValue in interface Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,​List<Integer>>
      Parameters:
      aggregate - A; aggregate result
      format - String; format string
      Returns:
      String; string representation of the aggregate result
    • toString

      public String toString()
      Overrides:
      toString in class Object