Interface Detector.DetectorMeasurement<C,A>
- Type Parameters:
C- accumulated typeA- aggregated type
- All Known Implementing Classes:
Detector.PlatoonSizes
- Enclosing class:
- Detector
public static interface Detector.DetectorMeasurement<C,A>
Interface for what detectors measure.
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 12 mrt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Method Summary
Modifier and Type Method Description CaccumulateEntry(C cumulative, LaneBasedGTU gtu, Detector loopDetector)Returns an accumulated value for when the front reaches the detector.CaccumulateExit(C cumulative, LaneBasedGTU gtu, Detector loopDetector)Returns an accumulated value for when the rear leaves the detector.Aaggregate(C cumulative, int count, Duration aggregation)Returns an aggregated value.StringgetName()Returns the value name.Cidentity()Returns the initial value before accumulation.booleanisPeriodic()Returns whether the measurement aggregates every aggregation period (or only over the entire simulation).StringstringValue(A aggregate, String format)Returns a string representation of the aggregate result.
-
Method Details
-
identity
C identity()Returns the initial value before accumulation.- Returns:
- C; initial value before accumulation
-
accumulateEntry
Returns an accumulated value for when the front reaches the detector.- Parameters:
cumulative- C; accumulated valuegtu- LaneBasedGTU; gtuloopDetector- Detector; loop detector- Returns:
- C; accumulated value
-
accumulateExit
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.- Parameters:
cumulative- C; accumulated valuegtu- LaneBasedGTU; gtuloopDetector- Detector; loop detector- Returns:
- C; accumulated value
-
isPeriodic
boolean isPeriodic()Returns whether the measurement aggregates every aggregation period (or only over the entire simulation).- Returns:
- boolean; whether the measurement aggregates every aggregation period (or only over the entire simulation)
-
aggregate
Returns an aggregated value.- Parameters:
cumulative- C; accumulated valuecount- int; GTU countaggregation- Duration; aggregation period- Returns:
- A; aggregated value
-
getName
String getName()Returns the value name.- Returns:
- String; value name
-
stringValue
Returns a string representation of the aggregate result.- Parameters:
aggregate- A; aggregate resultformat- String; format string- Returns:
- String; string representation of the aggregate result
-