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-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 3 apr. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description TaskHeadwayCollector(Speed speed)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
TaskHeadwayCollector
public TaskHeadwayCollector(Speed speed)
Constructor.- Parameters:
speed
- Speed; speed
-
-
Method Detail
-
getIdentity
public Supplier<Duration> getIdentity()
Returns the identity value, the initial intermediate value.- Specified by:
getIdentity
in interfacePerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>
- Returns:
- I; identity value, the initial intermediate value
-
getAccumulator
public PerceptionCollectable.PerceptionAccumulator<LaneBasedGTU,Duration> getAccumulator()
Returns the accumulator.- Specified by:
getAccumulator
in interfacePerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>
- Returns:
- PerceptionAccumulator; accumulator
-
getFinalizer
public PerceptionCollectable.PerceptionFinalizer<Duration,Duration> getFinalizer()
Returns the finalizer.- Specified by:
getFinalizer
in interfacePerceptionCollectable.PerceptionCollector<Duration,LaneBasedGTU,Duration>
- Returns:
- PerceptionFinalizer; finalizer
-
-