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,java.util.List<java.lang.Integer>>
- Enclosing class:
- Detector
public static class Detector.PlatoonSizes extends java.lang.Object implements Detector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurementaccumulateEntry(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.PlatoonMeasurementaccumulateExit(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.java.util.List<java.lang.Integer>aggregate(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, int count, Duration aggregation)Returns an aggregated value.java.lang.StringgetName()Returns the value name.org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurementidentity()Returns the initial value before accumulation.booleanisPeriodic()Returns whether the measurement aggregates every aggregation period (or only over the entire simulation).java.lang.StringstringValue(java.util.List<java.lang.Integer> aggregate, java.lang.String format)Returns a string representation of the aggregate result.java.lang.StringtoString()
-
-
-
Constructor Detail
-
PlatoonSizes
public PlatoonSizes(Duration threshold)
Constructor.- Parameters:
threshold- Duration; maximum time between two vehicles that are considered to be in the same platoon
-
-
Method Detail
-
identity
public org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement identity()
Returns the initial value before accumulation.- Specified by:
identityin interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.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. 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:
accumulateEntryin interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.Integer>>- Parameters:
cumulative- C; accumulated valuegtu- LaneBasedGTU; gtuloopDetector- 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:
accumulateExitin interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.Integer>>- Parameters:
cumulative- C; accumulated valuegtu- LaneBasedGTU; gtuloopDetector- 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:
isPeriodicin interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.Integer>>- Returns:
- boolean; whether the measurement aggregates every aggregation period (or only over the entire simulation)
-
aggregate
public java.util.List<java.lang.Integer> aggregate(org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement cumulative, int count, Duration aggregation)
Returns an aggregated value.- Specified by:
aggregatein interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.Integer>>- Parameters:
cumulative- C; accumulated valuecount- int; GTU countaggregation- Duration; aggregation period- Returns:
- A; aggregated value
-
getName
public java.lang.String getName()
Returns the value name.- Specified by:
getNamein interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.Integer>>- Returns:
- String; value name
-
stringValue
public java.lang.String stringValue(java.util.List<java.lang.Integer> aggregate, java.lang.String format)Returns a string representation of the aggregate result.- Specified by:
stringValuein interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,java.util.List<java.lang.Integer>>- Parameters:
aggregate- A; aggregate resultformat- String; format string- Returns:
- String; string representation of the aggregate result
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-