Class AbstractDirectedLaneChangeModel
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.directedlanechange.AbstractDirectedLaneChangeModel
- All Implemented Interfaces:
DirectedLaneChangeModel
- Direct Known Subclasses:
DirectedAltruistic
,DirectedEgoistic
public abstract class AbstractDirectedLaneChangeModel
extends Object
implements DirectedLaneChangeModel
Common code for a family of lane change models like in M. Treiber and A. Kesting Traffic Flow Dynamics,
Springer-Verlag Berlin Heidelberg 2013, pp 239-244.
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:
- Peter Knoppers
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Comfortable deceleration parameter type. -
Constructor Summary
ConstructorDescriptionAbstractDirectedLaneChangeModel
(LanePerception perception) Construct a DirectedLaneChangeModel. -
Method Summary
Modifier and TypeMethodDescriptionabstract org.djunits.value.vdouble.scalar.Acceleration
applyDriverPersonality
(DualAccelerationStep accelerationStep) Return the weighted acceleration as described by the personality.final DirectedLaneMovementStep
computeLaneChangeAndAcceleration
(LaneBasedGtu gtu, LateralDirectionality direction, Collection<Headway> sameLaneGTUs, Collection<Headway> otherLaneGTUs, org.djunits.value.vdouble.scalar.Length maxDistance, org.djunits.value.vdouble.scalar.Speed speedLimit, org.djunits.value.vdouble.scalar.Acceleration otherLaneRouteIncentive, org.djunits.value.vdouble.scalar.Acceleration laneChangeThreshold, org.djunits.value.vdouble.scalar.Duration laneChangeTime) Compute the acceleration and lane change.final LanePerception
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opentrafficsim.road.gtu.lane.tactical.directedlanechange.DirectedLaneChangeModel
getLongName, getName
-
Field Details
-
B
protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BComfortable deceleration parameter type.
-
-
Constructor Details
-
AbstractDirectedLaneChangeModel
Construct a DirectedLaneChangeModel.- Parameters:
perception
- LanePerception; the perception.
-
-
Method Details
-
computeLaneChangeAndAcceleration
public final DirectedLaneMovementStep computeLaneChangeAndAcceleration(LaneBasedGtu gtu, LateralDirectionality direction, Collection<Headway> sameLaneGTUs, Collection<Headway> otherLaneGTUs, org.djunits.value.vdouble.scalar.Length maxDistance, org.djunits.value.vdouble.scalar.Speed speedLimit, org.djunits.value.vdouble.scalar.Acceleration otherLaneRouteIncentive, org.djunits.value.vdouble.scalar.Acceleration laneChangeThreshold, org.djunits.value.vdouble.scalar.Duration laneChangeTime) throws GtuException, org.opentrafficsim.base.parameters.ParameterException, OperationalPlanException Compute the acceleration and lane change.- Specified by:
computeLaneChangeAndAcceleration
in interfaceDirectedLaneChangeModel
- Parameters:
gtu
- LaneBasedGtu; the GTU for which the acceleration and lane change is computeddirection
- LateralDirectionality; the direction of the lane we want to change tosameLaneGTUs
- Collection<Headway>; the set of information about observable GTUs in the current lane (can not be null and may include thegtu
)otherLaneGTUs
- Collection<Headway>; the set of information about observable GTUs in the adjacent lane where GTUs should drive in the absence of other traffic (must be null if there is no such lane)maxDistance
- Length; the maximum distance that the current GTU can drive, e.g. due to a lane dropspeedLimit
- Speed; the local speed limitotherLaneRouteIncentive
- Acceleration; route incentive to merge to the adjacent lane where GTUs should drive in the absence of other trafficlaneChangeThreshold
- Acceleration; threshold that prevents lane changes that have very little benefit merge to overtake other trafficlaneChangeTime
- Duration; time spent to overtake- Returns:
- LaneMovementStep; the result of the lane change and GTU following model
- Throws:
GtuException
- when the position of the GTU on the lane(s) cannot be determinedorg.opentrafficsim.base.parameters.ParameterException
- in case of a parameter problem.OperationalPlanException
- if DefaultAlexander perception category is not present
-
applyDriverPersonality
public abstract org.djunits.value.vdouble.scalar.Acceleration applyDriverPersonality(DualAccelerationStep accelerationStep) Return the weighted acceleration as described by the personality. This incorporates the personality of the driver to the lane change decisions.- Parameters:
accelerationStep
- DualAccelerationStep; the DualAccelerationStep that contains the AccelerationStep that the reference GTU will make and the AccelerationStep that the (new) follower GTU will make- Returns:
- Acceleration; the acceleration that the personality of the driver uses (in a comparison to a similarly computed acceleration in the non-, or different-lane-changed state) to decide if a lane change should be performed
-
getPerception
- Specified by:
getPerception
in interfaceDirectedLaneChangeModel
- Returns:
- the perception.
-