Class OperationalPlan.AccelerationSegment

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    OperationalPlan

    public static class OperationalPlan.AccelerationSegment
    extends OperationalPlan.Segment
    The segment of an operational plan in which the acceleration is constant.

    Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
    All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 14, 2015
    Author:
    Alexander Verbraeck, Peter Knoppers
    See Also:
    Serialized Form
    • Constructor Detail

      • AccelerationSegment

        public AccelerationSegment​(Duration duration,
                                   Acceleration acceleration)
        Parameters:
        duration - Duration; the duration of the constant acceleration for this segment
        acceleration - Acceleration; the acceleration for the given duration
    • Method Detail

      • distanceSI

        final double distanceSI​(double t)
        Calculate the distance covered by a GTU in this segment after relative time t.
        Specified by:
        distanceSI in class OperationalPlan.Segment
        Parameters:
        t - double; the relative time since starting this segment for which to calculate the distance covered
        Returns:
        distance covered
      • accelerationSI

        final double accelerationSI​(double t)
        Calculate the acceleration of a GTU in this segment after relative time t.
        Specified by:
        accelerationSI in class OperationalPlan.Segment
        Parameters:
        t - double; the relative time since starting this segment for which to calculate the acceleration
        Returns:
        acceleration at relative time t
      • speedSI

        final double speedSI​(double t)
        Calculate the speed of a GTU in this segment after relative time t.
        Specified by:
        speedSI in class OperationalPlan.Segment
        Parameters:
        t - double; the relative time since starting this segment for which to calculate the speed
        Returns:
        speed at relative time t
      • timeAtDistance

        public final Duration timeAtDistance​(Length distance)
        Calculate the time it takes for the GTU to travel from the start of this Segment to the specified distance within this Segment.
        Specified by:
        timeAtDistance in class OperationalPlan.Segment
        Parameters:
        distance - Length; the distance for which the travel time has to be calculated
        Returns:
        the time at distance