Class AnticipationSpeed
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.categories.AnticipationSpeed
- All Implemented Interfaces:
PerceptionCollectable.PerceptionCollector<AnticipationSpeed.SpeedSet,LaneBasedGTU,AnticipationSpeed.SpeedSet>
public class AnticipationSpeed extends Object implements PerceptionCollectable.PerceptionCollector<AnticipationSpeed.SpeedSet,LaneBasedGTU,AnticipationSpeed.SpeedSet>
Collector of leaders which derives an set of anticipation speeds from a lane. This includes all GTUs on the lane (current),
all GTUs indicating left (left) and all GTUs indicating right (right).
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 2 mrt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnticipationSpeed.SpeedSetClass to contain info from 1 lane, regarding 3 lanes. -
Constructor Summary
Constructors Constructor Description AnticipationSpeed(Speed desiredSpeed, Length lookAhead, RelativeLane lane)Constructor. -
Method Summary
Modifier and Type Method Description PerceptionCollectable.PerceptionAccumulator<LaneBasedGTU,AnticipationSpeed.SpeedSet>getAccumulator()Returns the accumulator.PerceptionCollectable.PerceptionFinalizer<AnticipationSpeed.SpeedSet,AnticipationSpeed.SpeedSet>getFinalizer()Returns the finalizer.Supplier<AnticipationSpeed.SpeedSet>getIdentity()Returns the identity value, the initial intermediate value.
-
Constructor Details
-
AnticipationSpeed
Constructor.- Parameters:
desiredSpeed- Speed; desired speedlookAhead- Length; look-ahead distancelane- RelativeLane; lane
-
-
Method Details
-
getIdentity
Returns the identity value, the initial intermediate value.- Specified by:
getIdentityin interfacePerceptionCollectable.PerceptionCollector<AnticipationSpeed.SpeedSet,LaneBasedGTU,AnticipationSpeed.SpeedSet>- Returns:
- I; identity value, the initial intermediate value
-
getAccumulator
public PerceptionCollectable.PerceptionAccumulator<LaneBasedGTU,AnticipationSpeed.SpeedSet> getAccumulator()Returns the accumulator.- Specified by:
getAccumulatorin interfacePerceptionCollectable.PerceptionCollector<AnticipationSpeed.SpeedSet,LaneBasedGTU,AnticipationSpeed.SpeedSet>- Returns:
- PerceptionAccumulator; accumulator
-
getFinalizer
public PerceptionCollectable.PerceptionFinalizer<AnticipationSpeed.SpeedSet,AnticipationSpeed.SpeedSet> getFinalizer()Returns the finalizer.- Specified by:
getFinalizerin interfacePerceptionCollectable.PerceptionCollector<AnticipationSpeed.SpeedSet,LaneBasedGTU,AnticipationSpeed.SpeedSet>- Returns:
- PerceptionFinalizer; finalizer
-