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-2022 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
-
-
-
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,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. 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,List<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,List<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,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:
aggregatein interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,List<Integer>>- Parameters:
cumulative- C; accumulated valuecount- int; GTU countaggregation- Duration; aggregation period- Returns:
- A; aggregated value
-
getName
public String getName()
Returns the value name.- Specified by:
getNamein interfaceDetector.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:
stringValuein interfaceDetector.DetectorMeasurement<org.opentrafficsim.road.network.lane.object.sensor.Detector.PlatoonMeasurement,List<Integer>>- Parameters:
aggregate- A; aggregate resultformat- String; format string- Returns:
- String; string representation of the aggregate result
-
-