Class LaneChange.LaneChangePath.InterpolatedLaneChangePath

java.lang.Object
org.opentrafficsim.road.gtu.lane.plan.operational.LaneChange.LaneChangePath.InterpolatedLaneChangePath
All Implemented Interfaces:
LaneChange.LaneChangePath
Enclosing interface:
LaneChange.LaneChangePath

public abstract static class LaneChange.LaneChangePath.InterpolatedLaneChangePath extends Object implements LaneChange.LaneChangePath
Helper class for interpolation between the from and to center lines.

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
  • Constructor Details

    • InterpolatedLaneChangePath

      public InterpolatedLaneChangePath()
  • 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 of planDistance, 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 interface LaneChange.LaneChangePath
      Parameters:
      timeStep - Duration; time step
      planDistance - Length; distance covered during the operational plan
      meanSpeed - Speed; mean speed during time step
      from - LanePosition; current position on the from-lanes
      startPosition - OrientedPoint2d; current 2D position
      laneChangeDirection - LateralDirectionality; lane change direction
      fromLine - OtsLine2d; from line
      toLine - OtsLine2d; to line
      laneChangeDuration - Duration; current considered duration of the entire lane change
      lcFraction - double; fraction of lane change done so far
      Returns:
      OtsLine2d a (partial) path for a lane change
      Throws:
      OtsGeometryException - on wrong fractional position
    • longitudinalFraction

      abstract double longitudinalFraction(double lateralFraction)
      Transform lateral to longitudinal fraction.
      Parameters:
      lateralFraction - double; lateral fraction
      Returns:
      double; transformation of lateral to longitudinal fraction
    • lateralFraction

      abstract double lateralFraction(double longitudinalFraction)
      Transform longitudinal to lateral fraction.
      Parameters:
      longitudinalFraction - double; longitudinal fraction
      Returns:
      double; transformation of longitudinal to lateral fraction