Class TaskHeadwayCollector
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.categories.neighbors.TaskHeadwayCollector
- All Implemented Interfaces:
PerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>
public class TaskHeadwayCollector extends Object implements PerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>
Simple collector implementation to obtain time headway.
Copyright (c) 2013-2019 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 3 apr. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors Constructor Description TaskHeadwayCollector(Speed speed)Constructor. -
Method Summary
Modifier and Type Method Description PerceptionCollectable.PerceptionAccumulator<LaneBasedGTU,Duration>getAccumulator()Returns the accumulator.PerceptionCollectable.PerceptionFinalizer<Duration,Duration>getFinalizer()Returns the finalizer.Supplier<Duration>getIdentity()Returns the identity value, the initial intermediate value.
-
Constructor Details
-
TaskHeadwayCollector
Constructor.- Parameters:
speed- Speed; speed
-
-
Method Details
-
getIdentity
Returns the identity value, the initial intermediate value.- Specified by:
getIdentityin interfacePerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>- Returns:
- I; identity value, the initial intermediate value
-
getAccumulator
Returns the accumulator.- Specified by:
getAccumulatorin interfacePerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>- Returns:
- PerceptionAccumulator; accumulator
-
getFinalizer
Returns the finalizer.- Specified by:
getFinalizerin interfacePerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>- Returns:
- PerceptionFinalizer; finalizer
-