public class LaneChange extends Object implements Serializable
getPath()
for each step of the tactical planner.
Copyright (c) 2013-2017 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 |
---|---|
org.opentrafficsim.core.network.LateralDirectionality |
getDirection()
Return lateral lane change direction.
|
double |
getFraction()
Returns the fraction of the lane change performed.
|
org.opentrafficsim.core.geometry.OTSLine3D |
getPath(org.djunits.value.vdouble.scalar.Duration timeStep,
LaneBasedGTU gtu,
DirectedLanePosition from,
nl.tudelft.simulation.language.d3.DirectedPoint startPosition,
org.djunits.value.vdouble.scalar.Length planDistance,
org.opentrafficsim.core.network.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(org.djunits.value.vdouble.scalar.Length boundary)
Sets the distance within which a lane change should be finished.
|
void |
setDesiredLaneChangeDuration(org.djunits.value.vdouble.scalar.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(org.djunits.value.vdouble.scalar.Duration duration)
duration
- Duration; desired lane change durationpublic void setBoundary(org.djunits.value.vdouble.scalar.Length boundary)
boundary
- DirectedPoint; 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 org.opentrafficsim.core.network.LateralDirectionality getDirection()
public final RelativeLane getSecondLane(LaneBasedGTU gtu) throws org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException
gtu
- LaneBasedGTU; the GTUorg.opentrafficsim.core.gtu.plan.operational.OperationalPlanException
- If no lane change is being performed.public final org.opentrafficsim.core.geometry.OTSLine3D getPath(org.djunits.value.vdouble.scalar.Duration timeStep, LaneBasedGTU gtu, DirectedLanePosition from, nl.tudelft.simulation.language.d3.DirectedPoint startPosition, org.djunits.value.vdouble.scalar.Length planDistance, org.opentrafficsim.core.network.LateralDirectionality laneChangeDirection) throws org.opentrafficsim.core.geometry.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 directionorg.opentrafficsim.core.geometry.OTSGeometryException
- on path or shape errorCopyright © 2014–2018 Delft University of Technology. All rights reserved.