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
public class LaneBasedCFLCTacticalPlanner extends AbstractLaneBasedTacticalPlanner
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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 25, 2015
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Length
GETOFFTHISLANENOW
Return value of suitability when a lane change is required right now.protected static ParameterTypeLength
LOOKBACKOLD
Look back parameter type.static Length
NOLANECHANGENEEDED
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
Constructors Constructor Description LaneBasedCFLCTacticalPlanner(GTUFollowingModelOld carFollowingModel, LaneChangeModel laneChangeModel, LaneBasedGTU gtu)
Instantiated a tactical planner with GTU following and lane change behavior.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Length
computeSuitabilityWithLaneChanges(Lane startLane, double remainingDistance, Map<Lane,Length> suitabilities, int totalLanes, LateralDirectionality direction, GTUType gtuType, GTUDirectionality drivingDirection)
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 int
countCompatibleLanes(CrossSectionLink link, GTUType gtuType, GTUDirectionality drivingDirection)
Determine how many lanes on a CrossSectionLink are compatible with a particular GTU type.
TODO: this method should probably be moved into the CrossSectionLink classOperationalPlan
generateOperationalPlan(Time startTime, DirectedPoint locationAtStartTime)
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 Detail
-
LOOKBACKOLD
protected static final ParameterTypeLength LOOKBACKOLD
Look back parameter type.
-
NOLANECHANGENEEDED
public static final Length NOLANECHANGENEEDED
Return value of suitability when no lane change is required within the time horizon.
-
GETOFFTHISLANENOW
public static final Length GETOFFTHISLANENOW
Return value of suitability when a lane change is required right now.
-
-
Constructor Detail
-
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 Detail
-
generateOperationalPlan
public final OperationalPlan generateOperationalPlan(Time startTime, DirectedPoint locationAtStartTime) throws OperationalPlanException, NetworkException, GTUException, ParameterException
-
computeSuitabilityWithLaneChanges
protected final Length computeSuitabilityWithLaneChanges(Lane startLane, double remainingDistance, Map<Lane,Length> suitabilities, int totalLanes, LateralDirectionality direction, GTUType gtuType, GTUDirectionality drivingDirection)
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 GTUdrivingDirection
- GTUDirectionality; the driving direction of the GTU- Returns:
- double; the suitability of the startLane for following the Route
-
countCompatibleLanes
protected final int countCompatibleLanes(CrossSectionLink link, GTUType gtuType, GTUDirectionality drivingDirection)
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 typedrivingDirection
- GTUDirectionality; the driving direction on the link- Returns:
- integer; the number of lanes on the link that are compatible with the GTU type
-
-