Class AbstractIncentivesTacticalPlanner
java.lang.Object
org.opentrafficsim.road.gtu.tactical.AbstractLaneBasedTacticalPlanner
org.opentrafficsim.road.gtu.tactical.lmrs.AbstractIncentivesTacticalPlanner
- All Implemented Interfaces:
TacticalPlanner<LaneBasedGtu,,LanePerception> LaneBasedTacticalPlanner,AccelerationBased,DesireBased
- Direct Known Subclasses:
Lmrs
public abstract class AbstractIncentivesTacticalPlanner
extends AbstractLaneBasedTacticalPlanner
implements DesireBased, AccelerationBased
Tactical planner with mandatory lane change incentives, voluntary lane change incentives, and acceleration incentives. The
order in which the incentives are given is relevant. A later incentive can request the result from an earlier incentive at
the same time instance. Otherwise, it can only obtain the value of another incentive from the previous time step.
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
Fields inherited from class org.opentrafficsim.road.gtu.tactical.AbstractLaneBasedTacticalPlanner
DT, LANE_TACTICAL_PLANNER, LOOKAHEAD -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIncentivesTacticalPlanner(CarFollowingModel carFollowingModel, LaneBasedGtu gtu, LanePerception lanePerception) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAccelerationIncentive(AccelerationIncentive incentive) Adds an acceleration incentive.voidaddMandatoryIncentive(MandatoryIncentive incentive) Adds a mandatory incentive.voidaddVoluntaryIncentive(VoluntaryIncentive incentive) Adds a voluntary incentive.org.djunits.value.vdouble.scalar.AccelerationgetAcceleration(TacticalContextEgo context, RelativeLane lane, org.djunits.value.vdouble.scalar.Length mergeDistance) Determine acceleration.Returns the acceleration incentives.Optional<org.djunits.value.vdouble.scalar.Acceleration>getLatestAcceleration(Class<? extends AccelerationIncentive> incentiveClass) Return latest acceleration of incentive class.getLatestDesire(Class<? extends Incentive> incentive) Returns the latest desire from the specified incentive.Returns the latest total mandatory desire.Returns the latest total voluntary desire.getMandatoryDesire(TacticalContextEgo context) Determines level of lane change desire for mandatory lane change incentives.Returns the mandatory incentives.getVoluntaryDesire(TacticalContextEgo context) Determines level of lane change desire for voluntary lane change incentives.Returns the voluntary incentives.Methods inherited from class org.opentrafficsim.road.gtu.tactical.AbstractLaneBasedTacticalPlanner
getCarFollowingModel, getGtu, getPerception, setCarFollowingModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opentrafficsim.road.gtu.tactical.LaneBasedTacticalPlanner
chooseLaneAtSplitMethods inherited from interface org.opentrafficsim.core.gtu.plan.tactical.TacticalPlanner
generateOperationalPlan
-
Constructor Details
-
AbstractIncentivesTacticalPlanner
public AbstractIncentivesTacticalPlanner(CarFollowingModel carFollowingModel, LaneBasedGtu gtu, LanePerception lanePerception) Constructor.- Parameters:
carFollowingModel- Car-following model.gtu- GTUlanePerception- perception
-
-
Method Details
-
addMandatoryIncentive
Adds a mandatory incentive. Ignoresnull.- Parameters:
incentive- Incentive to add.
-
addVoluntaryIncentive
Adds a voluntary incentive. Ignoresnull.- Parameters:
incentive- Incentive to add.
-
addAccelerationIncentive
Adds an acceleration incentive. Ignoresnull.- Parameters:
incentive- Incentive to add.
-
getMandatoryIncentives
Returns the mandatory incentives.- Returns:
- mandatory incentives
-
getVoluntaryIncentives
Returns the voluntary incentives.- Returns:
- voluntary incentives
-
getAccelerationIncentives
Returns the acceleration incentives.- Returns:
- acceleration incentives
-
getMandatoryDesire
public Desire getMandatoryDesire(TacticalContextEgo context) throws OperationalPlanException, ParameterException Determines level of lane change desire for mandatory lane change incentives.- Parameters:
context- tactical information such as parameters and car-following model- Returns:
- level of lane change desire for this incentive
- Throws:
ParameterException- if a parameter is not given or out of boundsOperationalPlanException- in case of a perception exception
-
getVoluntaryDesire
public Desire getVoluntaryDesire(TacticalContextEgo context) throws OperationalPlanException, ParameterException Determines level of lane change desire for voluntary lane change incentives.- Parameters:
context- tactical information such as parameters and car-following model- Returns:
- level of lane change desire for this incentive
- Throws:
ParameterException- if a parameter is not given or out of boundsOperationalPlanException- in case of a perception exception
-
getLatestMandatoryDesire
Returns the latest total mandatory desire.- Returns:
- latest total mandatory desire
-
getLatestVoluntaryDesire
Returns the latest total voluntary desire.- Returns:
- latest total voluntary desire
-
getLatestDesire
Description copied from interface:DesireBasedReturns the latest desire from the specified incentive.- Specified by:
getLatestDesirein interfaceDesireBased- Parameters:
incentive- incentive class- Returns:
- latest desire from the specified incentive, empty if this incentive is not active
-
getAcceleration
public org.djunits.value.vdouble.scalar.Acceleration getAcceleration(TacticalContextEgo context, RelativeLane lane, org.djunits.value.vdouble.scalar.Length mergeDistance) throws ParameterException, GtuException Determine acceleration.- Parameters:
context- tactical information such as parameters and car-following modellane- lane on which to consider the accelerationmergeDistance- distance over which a lane change is impossible towards the lane, zero if current lane- Returns:
- acceleration
- Throws:
ParameterException- on missing parameterGtuException- when there is a problem with the state of the GTU when planning a path
-
getLatestAcceleration
public Optional<org.djunits.value.vdouble.scalar.Acceleration> getLatestAcceleration(Class<? extends AccelerationIncentive> incentiveClass) Description copied from interface:AccelerationBasedReturn latest acceleration of incentive class.- Specified by:
getLatestAccelerationin interfaceAccelerationBased- Parameters:
incentiveClass- incentive class- Returns:
- latest acceleration, or empty if incentive does not apply
-