Class TaskHeadwayCollector
java.lang.Object
org.opentrafficsim.road.gtu.perception.categories.neighbors.TaskHeadwayCollector
- All Implemented Interfaces:
PerceptionCollectable.PerceptionCollector<org.djunits.value.vdouble.scalar.Duration,LaneBasedGtu, org.djunits.value.vdouble.scalar.Duration>
public class TaskHeadwayCollector
extends Object
implements PerceptionCollectable.PerceptionCollector<org.djunits.value.vdouble.scalar.Duration,LaneBasedGtu,org.djunits.value.vdouble.scalar.Duration>
Simple collector implementation to obtain time headway.
Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorsConstructorDescriptionTaskHeadwayCollector(org.djunits.value.vdouble.scalar.Speed speed) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionPerceptionCollectable.PerceptionAccumulator<LaneBasedGtu,org.djunits.value.vdouble.scalar.Duration> Returns the accumulator.Function<org.djunits.value.vdouble.scalar.Duration,org.djunits.value.vdouble.scalar.Duration> Returns the finalizer.Supplier<org.djunits.value.vdouble.scalar.Duration>Returns the identity value, the initial intermediate value.
-
Constructor Details
-
TaskHeadwayCollector
public TaskHeadwayCollector(org.djunits.value.vdouble.scalar.Speed speed) Constructor.- Parameters:
speed- speed
-
-
Method Details
-
getIdentity
Description copied from interface:PerceptionCollectable.PerceptionCollectorReturns the identity value, the initial intermediate value.- Specified by:
getIdentityin interfacePerceptionCollectable.PerceptionCollector<org.djunits.value.vdouble.scalar.Duration,LaneBasedGtu, org.djunits.value.vdouble.scalar.Duration> - Returns:
- identity value, the initial intermediate value
-
getAccumulator
public PerceptionCollectable.PerceptionAccumulator<LaneBasedGtu,org.djunits.value.vdouble.scalar.Duration> getAccumulator()Description copied from interface:PerceptionCollectable.PerceptionCollectorReturns the accumulator.- Specified by:
getAccumulatorin interfacePerceptionCollectable.PerceptionCollector<org.djunits.value.vdouble.scalar.Duration,LaneBasedGtu, org.djunits.value.vdouble.scalar.Duration> - Returns:
- accumulator
-
getFinalizer
public Function<org.djunits.value.vdouble.scalar.Duration,org.djunits.value.vdouble.scalar.Duration> getFinalizer()Description copied from interface:PerceptionCollectable.PerceptionCollectorReturns the finalizer.- Specified by:
getFinalizerin interfacePerceptionCollectable.PerceptionCollector<org.djunits.value.vdouble.scalar.Duration,LaneBasedGtu, org.djunits.value.vdouble.scalar.Duration> - Returns:
- finalizer
-