public class LaneChange extends Object implements Serializable
getPath() for each step of the tactical planner.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Class and Description |
|---|---|
static interface |
LaneChange.LaneChangePath
Provides a (partial) path during lane changes.
|
| Modifier and Type | Field and Description |
|---|---|
static double |
MIN_LC_LENGTH_FACTOR
Minimum distance required to perform a lane change as factor on vehicle length.
|
| Constructor and Description |
|---|
LaneChange() |
| Modifier and Type | Method and Description |
|---|---|
LateralDirectionality |
getDirection()
Return lateral lane change direction.
|
double |
getFraction()
Returns the fraction of the lane change performed.
|
OTSLine3D |
getPath(Duration timeStep,
LaneBasedGTU gtu,
DirectedLanePosition from,
DirectedPoint startPosition,
Length planDistance,
LateralDirectionality laneChangeDirection)
Returns the path for a lane change.
|
RelativeLane |
getSecondLane(LaneBasedGTU gtu)
Second lane of lane change relative to the reference lane.
|
boolean |
isChangingLane()
Return whether the GTU is changing lane.
|
boolean |
isChangingLeft()
Return whether the GTU is changing left.
|
boolean |
isChangingRight()
Return whether the GTU is changing right.
|
void |
setBoundary(Length boundary)
Sets the distance within which a lane change should be finished.
|
void |
setDesiredLaneChangeDuration(Duration duration)
Sets the desired lane change duration.
|
void |
setLaneChangePath(LaneChange.LaneChangePath laneChangePath)
Sets a lane change path.
|
String |
toString() |
public static double MIN_LC_LENGTH_FACTOR
public void setDesiredLaneChangeDuration(Duration duration)
duration - Duration; desired lane change durationpublic void setBoundary(Length boundary)
boundary - Length; boundarypublic double getFraction()
public void setLaneChangePath(LaneChange.LaneChangePath laneChangePath)
laneChangePath - LaneChangePath; lane change pathpublic final boolean isChangingLane()
public final boolean isChangingLeft()
public final boolean isChangingRight()
public final LateralDirectionality getDirection()
public final RelativeLane getSecondLane(LaneBasedGTU gtu) throws OperationalPlanException
gtu - LaneBasedGTU; the GTUOperationalPlanException - If no lane change is being performed.public final OTSLine3D getPath(Duration timeStep, LaneBasedGTU gtu, DirectedLanePosition from, DirectedPoint startPosition, Length planDistance, LateralDirectionality laneChangeDirection) throws OTSGeometryException
timeStep - Duration; plan time stepgtu - LaneBasedGTU; gtufrom - DirectedLanePosition; current position on the from lane (i.e. not necessarily the reference position)startPosition - DirectedPoint; current position in 2DplanDistance - Length; absolute distance that will be covered during the time steplaneChangeDirection - LateralDirectionality; lane change directionOTSGeometryException - on path or shape errorCopyright © 2014–2019 Delft University of Technology. All rights reserved.