Class AnticipationTrafficPerception
java.lang.Object
org.opentrafficsim.base.Type<AbstractPerceptionCategory<G,P>>
org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<LaneBasedGTU,LanePerception>
org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
org.opentrafficsim.road.gtu.lane.perception.categories.AnticipationTrafficPerception
- All Implemented Interfaces:
Serializable,PerceptionCategory<LaneBasedGTU,LanePerception>,LaneBasedPerceptionCategory,TrafficPerception
public class AnticipationTrafficPerception extends LaneBasedAbstractPerceptionCategory implements TrafficPerception
Traffic perception using neighbors perception. Speed is anticipated as in the LMRS. Density is simply distance of the
farthest leader divided by the number of leaders.
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 13 mrt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected static ParameterTypeLengthLOOKAHEADLook ahead parameter type.Fields inherited from class org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
MAX_RED_DECELERATION, MAX_YELLOW_DECELERATION -
Constructor Summary
Constructors Constructor Description AnticipationTrafficPerception(LanePerception perception)Constructor. -
Method Summary
Modifier and Type Method Description LinearDensitygetDensity(RelativeLane lane)Returns the perceived density on the given lane.SpeedgetSpeed(RelativeLane lane)Returns the perceived speed on the given lane.StringtoString()voidupdateAll()Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
computeIfAbsent, computeIfAbsent, computeIfAbsentMethods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory
getGtu, getObjectOrNull, getPerception, getTimestamp
-
Field Details
-
LOOKAHEAD
Look ahead parameter type.
-
-
Constructor Details
-
AnticipationTrafficPerception
Constructor.- Parameters:
perception- LanePerception; perception
-
-
Method Details
-
getSpeed
Returns the perceived speed on the given lane.- Specified by:
getSpeedin interfaceTrafficPerception- Parameters:
lane- RelativeLane; lane- Returns:
- Speed perceived speed on the given lane
- Throws:
ParameterException- on parameter exception
-
getDensity
Returns the perceived density on the given lane.- Specified by:
getDensityin interfaceTrafficPerception- Parameters:
lane- RelativeLane; lane- Returns:
- LinearDensity perceived density on the given lane
-
updateAll
- Specified by:
updateAllin interfacePerceptionCategory<LaneBasedGTU,LanePerception>- Throws:
GTUExceptionNetworkExceptionParameterException
-
toString
-