Class LaneChange.LaneChangePath.SequentialLaneChangePath

    • Constructor Detail

      • SequentialLaneChangePath

        public SequentialLaneChangePath()
    • Method Detail

      • getPath

        public OTSLine3D getPath​(Duration timeStep,
                                 Length planDistance,
                                 Speed meanSpeed,
                                 DirectedLanePosition from,
                                 DirectedPoint startPosition,
                                 LateralDirectionality laneChangeDirection,
                                 OTSLine3D fromLine,
                                 OTSLine3D toLine,
                                 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 - DirectedLanePosition; current position on the from-lanes
        startPosition - DirectedPoint; current 2D position
        laneChangeDirection - LateralDirectionality; lane change direction
        fromLine - OTSLine3D; from line
        toLine - OTSLine3D; to line
        laneChangeDuration - Duration; current considered duration of the entire lane change
        lcFraction - double; fraction of lane change done so far
        Returns:
        OTSLine3D 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 end
        cumulLcLength - double; cumulative length (along from lanes) covered so far
        totalLcLength - double; total (along from lanes) length to cover in lane change
        Returns:
        double; angle, relative to the lane center line