Class LaneChange.LaneChangePath.SequentialLaneChangePath
java.lang.Object
org.opentrafficsim.road.gtu.lane.plan.operational.LaneChange.LaneChangePath.SequentialLaneChangePath
- All Implemented Interfaces:
LaneChange.LaneChangePath
- Enclosing interface:
- LaneChange.LaneChangePath
public abstract static class LaneChange.LaneChangePath.SequentialLaneChangePath
extends Object
implements LaneChange.LaneChangePath
A helper class to allow a lane change to follow a sequential determination of the target position (including
rotation) for each time step.
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, Wouter Schakel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.plan.operational.LaneChange.LaneChangePath
LaneChange.LaneChangePath.InterpolatedLaneChangePath, LaneChange.LaneChangePath.SequentialLaneChangePath
-
Field Summary
Fields inherited from interface org.opentrafficsim.road.gtu.lane.plan.operational.LaneChange.LaneChangePath
BEZIER, LINEAR, POLY3, SINE, SINE_INTERP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract double
angle
(double width, double cumulLcLength, double totalLcLength) Returns the angle, relative to the lane center line, at the given cumulative length for a lane change of given total length and lateral deviation.getPath
(org.djunits.value.vdouble.scalar.Duration timeStep, org.djunits.value.vdouble.scalar.Length planDistance, org.djunits.value.vdouble.scalar.Speed meanSpeed, LanePosition from, org.djutils.draw.point.OrientedPoint2d startPosition, LateralDirectionality laneChangeDirection, OtsLine2d fromLine, OtsLine2d toLine, org.djunits.value.vdouble.scalar.Duration laneChangeDuration, double lcFraction) Returns a (partial) path for a lane change.protected abstract double
lateralFraction
(double lcFraction) Returns the fractional lateral deviation given a fraction of lane change being completed.
-
Constructor Details
-
SequentialLaneChangePath
public SequentialLaneChangePath()
-
-
Method Details
-
getPath
public OtsLine2d getPath(org.djunits.value.vdouble.scalar.Duration timeStep, org.djunits.value.vdouble.scalar.Length planDistance, org.djunits.value.vdouble.scalar.Speed meanSpeed, LanePosition from, org.djutils.draw.point.OrientedPoint2d startPosition, LateralDirectionality laneChangeDirection, OtsLine2d fromLine, OtsLine2d toLine, org.djunits.value.vdouble.scalar.Duration laneChangeDuration, double lcFraction) throws OtsGeometryException Returns a (partial) path for a lane change. The method is called both at the start and during a lane change, and should return a valid path. This path should at least have a length ofplanDistance
, unless the lane change will be finished during the coming time step. In that case, the caller of this method is to lengthen the path along the center line of the target lane.- Specified by:
getPath
in interfaceLaneChange.LaneChangePath
- Parameters:
timeStep
- Duration; time stepplanDistance
- Length; distance covered during the operational planmeanSpeed
- Speed; mean speed during time stepfrom
- LanePosition; current position on the from-lanesstartPosition
- OrientedPoint2d; current 2D positionlaneChangeDirection
- LateralDirectionality; lane change directionfromLine
- OtsLine2d; from linetoLine
- OtsLine2d; to linelaneChangeDuration
- Duration; current considered duration of the entire lane changelcFraction
- double; fraction of lane change done so far- Returns:
- OtsLine2d a (partial) path for a lane change
- Throws:
OtsGeometryException
- on wrong fractional position
-
lateralFraction
protected abstract double lateralFraction(double lcFraction) Returns the fractional lateral deviation given a fraction of lane change being completed.- Parameters:
lcFraction
- double; fraction of lane change- Returns:
- double; lateral deviation
-
angle
protected abstract double angle(double width, double cumulLcLength, double totalLcLength) Returns the angle, relative to the lane center line, at the given cumulative length for a lane change of given total length and lateral deviation.- Parameters:
width
- double; lateral deviation from from lanes at lane change endcumulLcLength
- double; cumulative length (along from lanes) covered so fartotalLcLength
- double; total (along from lanes) length to cover in lane change- Returns:
- double; angle, relative to the lane center line
-