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-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 13 mrt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.opentrafficsim.base.parameters.ParameterTypeLength
LOOKAHEAD
Look 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearDensity
getDensity(RelativeLane lane)
Returns the perceived density on the given lane.Speed
getSpeed(RelativeLane lane)
Returns the perceived speed on the given lane.String
toString()
void
updateAll()
-
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
computeIfAbsent, computeIfAbsent, computeIfAbsent
-
Methods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory
getGtu, getObjectOrNull, getPerception, getTimestamp
-
-
-
-
Constructor Detail
-
AnticipationTrafficPerception
public AnticipationTrafficPerception(LanePerception perception)
Constructor.- Parameters:
perception
- LanePerception; perception
-
-
Method Detail
-
getSpeed
public Speed getSpeed(RelativeLane lane) throws org.opentrafficsim.base.parameters.ParameterException
Returns the perceived speed on the given lane.- Specified by:
getSpeed
in interfaceTrafficPerception
- Parameters:
lane
- RelativeLane; lane- Returns:
- Speed perceived speed on the given lane
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- on parameter exception
-
getDensity
public LinearDensity getDensity(RelativeLane lane)
Returns the perceived density on the given lane.- Specified by:
getDensity
in interfaceTrafficPerception
- Parameters:
lane
- RelativeLane; lane- Returns:
- LinearDensity perceived density on the given lane
-
updateAll
public void updateAll() throws GTUException, NetworkException, org.opentrafficsim.base.parameters.ParameterException
- Specified by:
updateAll
in interfacePerceptionCategory<LaneBasedGTU,LanePerception>
- Throws:
GTUException
NetworkException
org.opentrafficsim.base.parameters.ParameterException
-
-