Class LaneBasedCfLcTacticalPlanner
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.AbstractLaneBasedTacticalPlanner
org.opentrafficsim.road.gtu.lane.tactical.LaneBasedCfLcTacticalPlanner
- All Implemented Interfaces:
Serializable
,TacticalPlanner<LaneBasedGtu,
,LanePerception> LaneBasedTacticalPlanner
Lane-based tactical planner that implements car following and lane change behavior. This lane-based tactical planner makes
decisions based on headway (GTU following model) and lane change (Lane Change model), and will generate an operational plan
for the GTU. It can ask the strategic planner for assistance on the route to take when the network splits.
Copyright (c) 2013-2024 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
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.djunits.value.vdouble.scalar.Length
Return value of suitability when a lane change is required right now.protected static final org.opentrafficsim.base.parameters.ParameterTypeLength
Look back parameter type.static final org.djunits.value.vdouble.scalar.Length
Return value of suitability when no lane change is required within the time horizon.Fields inherited from class org.opentrafficsim.road.gtu.lane.tactical.AbstractLaneBasedTacticalPlanner
DT, LOOKAHEAD, TACTICAL_PLANNER
-
Constructor Summary
ConstructorDescriptionLaneBasedCfLcTacticalPlanner
(GtuFollowingModelOld carFollowingModel, LaneChangeModel laneChangeModel, LaneBasedGtu gtu) Instantiated a tactical planner with GTU following and lane change behavior. -
Method Summary
Modifier and TypeMethodDescriptionprotected final org.djunits.value.vdouble.scalar.Length
computeSuitabilityWithLaneChanges
(Lane startLane, double remainingDistance, Map<Lane, org.djunits.value.vdouble.scalar.Length> suitabilities, int totalLanes, LateralDirectionality direction, GtuType gtuType) Compute the suitability of a lane from which lane changes are required to get to the next point on the Route.
This method weighs the suitability of the nearest suitable lane by (m - n) / m where n is the number of lane changes required and m is the total number of lanes in the CrossSectionLink.protected final int
countCompatibleLanes
(CrossSectionLink link, GtuType gtuType) Determine how many lanes on a CrossSectionLink are compatible with a particular GTU type.
TODO: this method should probably be moved into the CrossSectionLink classfinal OperationalPlan
generateOperationalPlan
(org.djunits.value.vdouble.scalar.Time startTime, org.djutils.draw.point.OrientedPoint2d locationAtStartTime) final String
toString()
Methods inherited from class org.opentrafficsim.road.gtu.lane.tactical.AbstractLaneBasedTacticalPlanner
buildLanePathInfo, buildLanePathInfo, buildLinkListForward, concatenateNull, connectsToPath, determineNextSplit, getCarFollowingModel, getGtu, getPerception, noLaneDrop, setCarFollowingModel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.road.gtu.lane.tactical.LaneBasedTacticalPlanner
chooseLaneAtSplit, okDistance
-
Field Details
-
LOOKBACKOLD
protected static final org.opentrafficsim.base.parameters.ParameterTypeLength LOOKBACKOLDLook back parameter type. -
NOLANECHANGENEEDED
public static final org.djunits.value.vdouble.scalar.Length NOLANECHANGENEEDEDReturn value of suitability when no lane change is required within the time horizon. -
GETOFFTHISLANENOW
public static final org.djunits.value.vdouble.scalar.Length GETOFFTHISLANENOWReturn value of suitability when a lane change is required right now.
-
-
Constructor Details
-
LaneBasedCfLcTacticalPlanner
public LaneBasedCfLcTacticalPlanner(GtuFollowingModelOld carFollowingModel, LaneChangeModel laneChangeModel, LaneBasedGtu gtu) Instantiated a tactical planner with GTU following and lane change behavior.- Parameters:
carFollowingModel
- GtuFollowingModelOld; Car-following model.laneChangeModel
- LaneChangeModel; Lane change model.gtu
- LaneBasedGtu; GTU
-
-
Method Details
-
generateOperationalPlan
public final OperationalPlan generateOperationalPlan(org.djunits.value.vdouble.scalar.Time startTime, org.djutils.draw.point.OrientedPoint2d locationAtStartTime) throws OperationalPlanException, NetworkException, GtuException, org.opentrafficsim.base.parameters.ParameterException - Throws:
OperationalPlanException
NetworkException
GtuException
org.opentrafficsim.base.parameters.ParameterException
-
computeSuitabilityWithLaneChanges
protected final org.djunits.value.vdouble.scalar.Length computeSuitabilityWithLaneChanges(Lane startLane, double remainingDistance, Map<Lane, org.djunits.value.vdouble.scalar.Length> suitabilities, int totalLanes, LateralDirectionality direction, GtuType gtuType) Compute the suitability of a lane from which lane changes are required to get to the next point on the Route.
This method weighs the suitability of the nearest suitable lane by (m - n) / m where n is the number of lane changes required and m is the total number of lanes in the CrossSectionLink.- Parameters:
startLane
- Lane; the current lane of the GTUremainingDistance
- double; distance in m of GTU to first branchsuitabilities
- Map<Lane, Length>; the set of suitable lanes and their suitabilitytotalLanes
- int; total number of lanes compatible with the GTU typedirection
- LateralDirectionality; the direction of the lane changes to attemptgtuType
- GtuType; the type of the GTU- Returns:
- double; the suitability of the startLane for following the Route
-
countCompatibleLanes
Determine how many lanes on a CrossSectionLink are compatible with a particular GTU type.
TODO: this method should probably be moved into the CrossSectionLink class- Parameters:
link
- CrossSectionLink; the linkgtuType
- GtuType; the GTU type- Returns:
- integer; the number of lanes on the link that are compatible with the GTU type
-
toString
-