Class AnticipationTrafficPerception
java.lang.Object
org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<LaneBasedGtu,LanePerception>
org.opentrafficsim.road.gtu.perception.categories.AnticipationTrafficPerception
- All Implemented Interfaces:
Type<AbstractPerceptionCategory<LaneBasedGtu,,LanePerception>> PerceptionCategory<LaneBasedGtu,,LanePerception> LaneBasedPerceptionCategory,TrafficPerception
public class AnticipationTrafficPerception
extends AbstractPerceptionCategory<LaneBasedGtu,LanePerception>
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-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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ParameterTypeLengthLook ahead parameter type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.djunits.value.vdouble.scalar.LinearDensitygetDensity(RelativeLane lane) Returns the perceived density on the given lane.org.djunits.value.vdouble.scalar.SpeedgetSpeed(RelativeLane lane, org.djunits.value.vdouble.scalar.Speed desiredSpeed) Returns the perceived speed on the given lane.toString()Methods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory
cacheAsString, computeIfAbsent, computeIfAbsent, computeIfAbsent, getGtu, getPerception, getTimestamp
-
Field Details
-
LOOKAHEAD
Look ahead parameter type.
-
-
Constructor Details
-
AnticipationTrafficPerception
Constructor.- Parameters:
perception- perception
-
-
Method Details
-
getSpeed
public org.djunits.value.vdouble.scalar.Speed getSpeed(RelativeLane lane, org.djunits.value.vdouble.scalar.Speed desiredSpeed) throws ParameterException Description copied from interface:TrafficPerceptionReturns the perceived speed on the given lane.- Specified by:
getSpeedin interfaceTrafficPerception- Parameters:
lane- lanedesiredSpeed- desired speed, to which the speed will tend when there is fewer traffic- Returns:
- Speed perceived speed on the given lane
- Throws:
ParameterException- on parameter exception
-
getDensity
Description copied from interface:TrafficPerceptionReturns the perceived density on the given lane.- Specified by:
getDensityin interfaceTrafficPerception- Parameters:
lane- lane- Returns:
- LinearDensity perceived density on the given lane
-
toString
-