Class RatePlanner

java.lang.Object
com.amalgamasimulation.core.scheduling.RatePlanner

@Deprecated public class RatePlanner extends Object
Deprecated.
Use PiecewiseFunction instead.
Class representing a piecewise linear function with steps. The values of the function can be bounded by some lower and upper bounds. These bounds affect only the limits to which the quantity can change because of a rate, specifically:
  • upper bound determines the maximum value to which quantity can grow at a positive rate,
  • lower bound determines the minimum value to which quantity can decrease at a negative rate.

The bounds do not impact the quantity step changes.

Typically, this class represents change to some quantity over time. Thus, in the API of this class, x-axis value is called time and y-axis value is called quantity (like in quantityAtTime(double) method). However this class can represent arguments and values of any nature.

Author:
Andrey Malykhanov
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Creates a new instance of an unbounded rate planner, i.e.
    RatePlanner(double upperBound, double lowerBound)
    Deprecated.
    Creates a new instance of a rate planner with the specified bounds.
    RatePlanner(double upperBound, double lowerBound, double initialQuantity, double initialRate)
    Deprecated.
    Creates a new instance of a rate planner with the specified bounds, initial quantity and initial rate.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    absoluteIntegral(double beginTime, double endTime)
    Deprecated.
    Returns an absolute integral of a piecewise linear function represented by this rate planner between the specified begin and end times.
    addQuantityChange(double time, double quantityDelta)
    Deprecated.
    Adds a quantity step change at the specified time by the specified positive or negative delta.
    addRate(double fromTime, double rateDelta)
    Deprecated.
    Adds the specified rate delta (positive or negative) to all rates starting at the specified time onwards to the time of Double.POSITIVE_INFINITY.
    addRate(double fromTime, double toTime, double rateDelta)
    Deprecated.
    Adds the specified rate delta (positive or negative) to all rates between the specified begin and end times.
    void
    Deprecated.
    Clears this rate planner, i.e.
    double
    closestAvailableQuantityTime(double quantity, double atOrAfterTime)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deprecated.
    Returns a copy of this rate planner.
    Deprecated.
    Returns the list of time intervals when there is deficit.
    double
    deficitQuantity(double beginTime, double endTime)
    Deprecated.
    Returns the sum of absolute quantities that the function would have decreased by if it was unbounded during the deficit periods between the specified begin time and end time.
    double
    durationAboveZero(double beginTime, double endTime)
    Deprecated, for removal: This API element is subject to removal in a future version.
    double
    durationNonNegative(double beginTime, double endTime)
    Deprecated, for removal: This API element is subject to removal in a future version.
    double
    durationWithQuantityMoreEqualThan(double beginTime, double endTime, double quantity)
    Deprecated.
    Returns the total duration of all periods between the specified begin and end times when the quantity was greater than or equal to the specified value.
    double
    durationWithQuantityMoreThan(double beginTime, double endTime, double quantity)
    Deprecated.
    Returns the total duration of all periods between the specified begin and end times when the quantity was greater than the specified value.
    double
    firstDeficitTime(double atOrAfterTime)
    Deprecated.
    Returns the time of a first deficit occurring at or after the specified time, or Double.POSITIVE_INFINITY if there is no such time.
    double
    firstOverflowTime(double atOrAfterTime)
    Deprecated.
    Returns the time of a first overflow occurring at or after the specified time, or Double.POSITIVE_INFINITY if there is no such time.
    double
    firstTimeQuantityLessEqualThan(double quantity, double atOrAfterTime)
    Deprecated.
    Returns the smallest time at or after the specified time when the quantity becomes less than or equal to the specified quantity.
    double
    firstTimeQuantityLessThan(double quantity, double atOrAfterTime)
    Deprecated.
    Returns the smallest time at or after the specified time when either: quantity is less than the specified quantity, or quantity is equal to the specified quantity and rate is negative.
    double
    firstTimeQuantityMoreEqualThan(double quantity, double atOrAfterTime)
    Deprecated.
    Returns the smallest time at or after the specified time when the quantity becomes greater than or equal to the specified quantity.
    double
    firstTimeQuantityMoreThan(double quantity, double atOrAfterTime)
    Deprecated.
    Returns the smallest time at or after the specified time when either: quantity is greater than the specified quantity, or quantity is equal to the specified quantity and rate is positive.
    getShifted(double horizontalShift)
    Deprecated.
    Returns a new rate planner that is equal to this rate planner shifted horizontally by the specified value.
    double
    integral(double beginTime, double endTime)
    Deprecated.
    Returns an integral of a piecewise linear function represented by this rate planner between the specified begin and end times.
    double
    Deprecated.
    Returns the lower bound of this rate planner, can be a finite number or a Double.NEGATIVE_INFINITY.
    double
    maxQuantity(double beginTime, double endTime)
    Deprecated.
    Returns the maximum value that the quantity of this rate planner reaches in the specified time interval.
    double
    maxQuantity(double beginTime, double endTime, boolean endTimeInclusive)
    Deprecated.
    Returns the maximum value that the quantity of this rate planner reaches in the specified time interval.
    double
    minQuantity(double beginTime, double endTime)
    Deprecated.
    Returns the minimum value that the quantity of this rate planner reaches in the specified time interval.
    double
    minQuantity(double beginTime, double endTime, boolean endTimeInclusive)
    Deprecated.
    Returns the minimum value that the quantity of this rate planner reaches in the specified time interval.
    minus(RatePlanner otherRatePlanner)
    Deprecated.
    Returns a new instance of RatePlanner that is a difference of this rate planner and the other specified rate planner.
    Deprecated.
    Returns a list of all negative step changes of quantity.
    double
    negativeQuantityChangesSum(double beginTime, double endTime)
    Deprecated.
    Returns the sum of all negative step changes between the specified begin and end times, inclusively.
    of(TimeStatistics timeStatistics)
    Deprecated.
    Creates a new instance of RatePlanner based on the data from the specified TimeStatistics instance.
    of(TimeStatistics timeStatistics, boolean cumulative)
    Deprecated.
    Creates a new instance of RatePlanner based on the data from the specified TimeStatistics instance.
    Deprecated.
    Returns the list of time intervals when there is overflow.
    double
    overflowQuantity(double beginTime, double endTime)
    Deprecated.
    Returns the sum of quantities that the function would have grown by if it was unbounded during the overflow periods between the specified begin time and end time.
    periodsWithRateLessThan(double lessThanRate)
    Deprecated.
    Returns the list of time intervals when the rate is less than the specified value.
    periodsWithRateMoreThan(double greaterThanRate)
    Deprecated.
    Returns the list of time intervals when the rate is greater than the specified value.
    Deprecated.
    Returns a list of bend points of a linear plot of this rate planner.
    plotData(double beginTime, double endTime)
    Deprecated.
    Returns a list of bend points of a linear plot of this rate planner in the specified time interval.
    plus(RatePlanner otherRatePlanner)
    Deprecated.
    Returns a new instance of RatePlanner that is a sum of this rate planner and the other specified rate planner.
    Deprecated.
    Returns a list of all positive step changes of quantity.
    double
    positiveQuantityChangesSum(double beginTime, double endTime)
    Deprecated.
    Returns the sum of all positive step changes between the specified begin and end times, inclusively.
    double
    quantityAtTime(double time)
    Deprecated.
    Returns the quantity at the specified time.
    setRate(double fromTime, double rate)
    Deprecated.
    Sets the rate from the specified time till the time of Double.POSITIVE_INFINITY.
    Deprecated.
    Returns a string representing Java code that creates this rate planner in its current state.
    Deprecated.
     
    double
    totalDecreaseQuantity(double beginTime, double endTime)
    Deprecated.
    Returns the absolute total quantity by which the function would have decreased during the specified interval as result of negative rates if it had been unbounded.
    double
    totalGrowthQuantity(double beginTime, double endTime)
    Deprecated.
    Returns the total quantity by which the function would have grown during the specified interval as result of positive rates if it had been unbounded.
    truncateAfter(double afterTime)
    Deprecated.
    Returns a new instance of a RatePlanner with all step and rate changes after the specified time removed.
    double
    Deprecated.
    Returns the upper bound of this rate planner, can be a finite number or a Double.POSITIVE_INFINITY.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RatePlanner

      public RatePlanner(double upperBound, double lowerBound, double initialQuantity, double initialRate)
      Deprecated.
      Creates a new instance of a rate planner with the specified bounds, initial quantity and initial rate.
      Parameters:
      upperBound - upper bound, the maximum value to which quantity can grow at a positive rate
      lowerBound - lower bound, the minimum value to which quantity can decrease at a negative rate
      initialQuantity - quantity at zero time
      initialRate - rate at zero time
    • RatePlanner

      public RatePlanner(double upperBound, double lowerBound)
      Deprecated.
      Creates a new instance of a rate planner with the specified bounds. Initial quantity and initial rate are equal to zero.
      Parameters:
      upperBound - upper bound, the maximum value to which quantity can grow at a positive rate
      lowerBound - lower bound, the minimum value to which quantity can decrease at a negative rate
    • RatePlanner

      public RatePlanner()
      Deprecated.
      Creates a new instance of an unbounded rate planner, i.e. the one with upper bound equal to Double.POSITIVE_INFINITY and lower bound equal to Double.NEGATIVE_INFINITY.
  • Method Details

    • clear

      public void clear()
      Deprecated.
      Clears this rate planner, i.e. removes all the rate changes and quantity step changes. Does not reset its upper and lower bounds.
    • upperBound

      public double upperBound()
      Deprecated.
      Returns the upper bound of this rate planner, can be a finite number or a Double.POSITIVE_INFINITY.
      Returns:
      upper bound of this rate planner
    • lowerBound

      public double lowerBound()
      Deprecated.
      Returns the lower bound of this rate planner, can be a finite number or a Double.NEGATIVE_INFINITY.
      Returns:
      lower bound of this rate planner
    • positiveQuantityChangesSum

      public double positiveQuantityChangesSum(double beginTime, double endTime)
      Deprecated.
      Returns the sum of all positive step changes between the specified begin and end times, inclusively.
      Parameters:
      beginTime - specified begin time, inclusively
      endTime - specified end time, inclusively
      Returns:
      sum of all positive step changes between the specified begin and end times
    • negativeQuantityChangesSum

      public double negativeQuantityChangesSum(double beginTime, double endTime)
      Deprecated.
      Returns the sum of all negative step changes between the specified begin and end times, inclusively.

      The returned value is always less than or equal to zero.

      Parameters:
      beginTime - specified begin time, inclusively
      endTime - specified end time, inclusively
      Returns:
      sum of all negative step changes between the specified begin and end times
    • negativeQuantityChanges

      public List<Pair<Double,Double>> negativeQuantityChanges()
      Deprecated.
      Returns a list of all negative step changes of quantity. Each element of the returned list is a Pair of Double values:
      • first element is the time of change,
      • second element is the quantity of change.

      The elements of the list are ordered by time of change in ascending order.

      Returns:
      list of Pair instances
    • positiveQuantityChanges

      public List<Pair<Double,Double>> positiveQuantityChanges()
      Deprecated.
      Returns a list of all positive step changes of quantity. Each element of the returned list is a Pair of Double values:
      • first element is the time of change,
      • second element is the quantity of change.

      The elements of the list are ordered by time of change in ascending order.

      Returns:
      list of Pair instances
    • closestAvailableQuantityTime

      @Deprecated(forRemoval=true) public double closestAvailableQuantityTime(double quantity, double atOrAfterTime)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • quantityAtTime

      public double quantityAtTime(double time)
      Deprecated.
      Returns the quantity at the specified time. Extrapolates the quantity linearly and applies the lower and upper bounds if needed.

      If there is one or several step changes at the specified time, returns the quantity after all the step changes.

      Parameters:
      time - specified time, can be infinite
      Returns:
      quantity at the specified time
    • firstDeficitTime

      public double firstDeficitTime(double atOrAfterTime)
      Deprecated.
      Returns the time of a first deficit occurring at or after the specified time, or Double.POSITIVE_INFINITY if there is no such time.

      Deficit is a situation when both of the following conditions hold true:

      • quantity is less than or equal to the lower bound, and
      • rate is less than zero.
      Parameters:
      atOrAfterTime - specified time
      Returns:
      time of a first deficit occurring at or after the specified time, or Double.POSITIVE_INFINITY
      See Also:
    • deficitPeriods

      public List<Pair<Double,Double>> deficitPeriods()
      Deprecated.
      Returns the list of time intervals when there is deficit. The time intervals in the returned list are represented with Pair-s of double values containing begin and end times of each corresponding interval. The intervals are ordered by begin time in ascending order.

      Deficit is a situation when both of the following conditions hold true:

      • quantity is less than or equal to the lower bound, and
      • rate is less than zero.
      Returns:
      list of time intervals with deficit
      See Also:
    • overflowPeriods

      public List<Pair<Double,Double>> overflowPeriods()
      Deprecated.
      Returns the list of time intervals when there is overflow. The time intervals in the returned list are represented with Pair-s of double values containing begin and end times of each corresponding interval. The intervals are ordered by begin time in ascending order.

      Overflow is a situation when both of the following conditions hold true:

      • quantity is greater than or equal to the upper bound, and
      • rate is greater than zero.
      Returns:
      list of time intervals with overflow
      See Also:
    • firstOverflowTime

      public double firstOverflowTime(double atOrAfterTime)
      Deprecated.
      Returns the time of a first overflow occurring at or after the specified time, or Double.POSITIVE_INFINITY if there is no such time.

      Overflow is a situation when both of the following conditions hold true:

      • quantity is greater than or equal to the upper bound, and
      • rate is greater than zero.
      Parameters:
      atOrAfterTime - specified time
      Returns:
      time of a first overflow occurring at or after the specified time, or Double.POSITIVE_INFINITY
      See Also:
    • firstTimeQuantityLessThan

      public double firstTimeQuantityLessThan(double quantity, double atOrAfterTime)
      Deprecated.
      Returns the smallest time at or after the specified time when either:
      • quantity is less than the specified quantity, or
      • quantity is equal to the specified quantity and rate is negative.
      Returns Double.POSITIVE_INFINITY if there is no such time.

      If at the specified time the quantity is already < specified quantity, returns the specified time.

      Parameters:
      quantity - specified quantity
      atOrAfterTime - specified time
      Returns:
      time when the quantity becomes less than the specified quantity, or Double.POSITIVE_INFINITY if there is no such time
    • firstTimeQuantityLessEqualThan

      public double firstTimeQuantityLessEqualThan(double quantity, double atOrAfterTime)
      Deprecated.
      Returns the smallest time at or after the specified time when the quantity becomes less than or equal to the specified quantity. Returns Double.POSITIVE_INFINITY if there is no such time.

      If at the specified time the quantity is already <= specified quantity, returns the specified time.

      Parameters:
      quantity - specified quantity
      atOrAfterTime - specified time
      Returns:
      time when the quantity becomes less than or equal to the specified quantity, or Double.POSITIVE_INFINITY if there is no such time
    • firstTimeQuantityMoreThan

      public double firstTimeQuantityMoreThan(double quantity, double atOrAfterTime)
      Deprecated.
      Returns the smallest time at or after the specified time when either:
      • quantity is greater than the specified quantity, or
      • quantity is equal to the specified quantity and rate is positive.
      Returns Double.POSITIVE_INFINITY if there is no such time.

      If at the specified time the quantity is already > specified quantity, returns the specified time.

      Parameters:
      quantity - specified quantity
      atOrAfterTime - specified time
      Returns:
      time when the quantity becomes greater than the specified quantity, or Double.POSITIVE_INFINITY if there is no such time
    • firstTimeQuantityMoreEqualThan

      public double firstTimeQuantityMoreEqualThan(double quantity, double atOrAfterTime)
      Deprecated.
      Returns the smallest time at or after the specified time when the quantity becomes greater than or equal to the specified quantity. Returns Double.POSITIVE_INFINITY if there is no such time.

      If at the specified time the quantity is already >= specified quantity, returns the specified time.

      Parameters:
      quantity - specified quantity
      atOrAfterTime - specified time
      Returns:
      time when the quantity becomes greater than or equal to the specified quantity, or Double.POSITIVE_INFINITY if there is no such time
    • maxQuantity

      public double maxQuantity(double beginTime, double endTime)
      Deprecated.
      Returns the maximum value that the quantity of this rate planner reaches in the specified time interval.
      Parameters:
      beginTime - begin time of the specified time interval
      endTime - end time of the specified time interval
      Returns:
      maximum value that the quantity of this rate planner reaches in the specified time interval
    • maxQuantity

      public double maxQuantity(double beginTime, double endTime, boolean endTimeInclusive)
      Deprecated.
      Returns the maximum value that the quantity of this rate planner reaches in the specified time interval.
      Parameters:
      beginTime - begin time of the specified time interval
      endTime - end time of the specified time interval
      Returns:
      maximum value that the quantity of this rate planner reaches in the specified time interval
    • minQuantity

      public double minQuantity(double beginTime, double endTime)
      Deprecated.
      Returns the minimum value that the quantity of this rate planner reaches in the specified time interval.
      Parameters:
      beginTime - begin time of the specified time interval
      endTime - end time of the specified time interval
      Returns:
      minimum value that the quantity of this rate planner reaches in the specified time interval
    • minQuantity

      public double minQuantity(double beginTime, double endTime, boolean endTimeInclusive)
      Deprecated.
      Returns the minimum value that the quantity of this rate planner reaches in the specified time interval.
      Parameters:
      beginTime - begin time of the specified time interval
      endTime - end time of the specified time interval
      Returns:
      minimum value that the quantity of this rate planner reaches in the specified time interval
    • plotData

      public List<Pair<Double,Double>> plotData()
      Deprecated.
      Returns a list of bend points of a linear plot of this rate planner. The returned list consists of Pair<Double,Double> instances. In each pair, the first element corresponds to the time and the second element corresponds to the quantity. The list is ordered by time in ascending order.

      Note that because of step changes, there can be up to 2 points for the same argument.

      The returned list does not contain any infinite numbers, so it can be easily used to draw a plot of the piecewise linear function represented by this rate planner.

      Returns:
      list of bend points of linear plot of this rate planner
    • plotData

      public List<Pair<Double,Double>> plotData(double beginTime, double endTime)
      Deprecated.
      Returns a list of bend points of a linear plot of this rate planner in the specified time interval. The returned list consists of Pair<Double,Double> instances. In each pair, the first element corresponds to the time and the second element corresponds to the quantity. The list is ordered by time in ascending order.

      Note that because of step changes, there can be up to 2 points for the same argument.

      The returned list does not contain any infinite numbers, so it can be easily used to draw a plot of the piecewise linear function represented by this rate planner.

      The returned list always contains points for the specified begin and end times, even if these points are not bend points of the plot.

      Parameters:
      beginTime - begin of the specified time interval
      endTime - end of the specified time interval
      Returns:
      list of bend points of linear plot of this rate planner
    • addQuantityChange

      public RatePlanner addQuantityChange(double time, double quantityDelta)
      Deprecated.
      Adds a quantity step change at the specified time by the specified positive or negative delta. The quantity step change is added with any other quantity step changes at the same time.

      Positive and negative step changes at the same time are accumulated separately and can be retrieved by calling methods positiveQuantityChangesSum(double, double) and negativeQuantityChangesSum(double, double).

      Parameters:
      time - time of the step change, must be finite
      quantityDelta - quantity of the step change, can be positive or negative
      Returns:
      reference to this instance, for support of fluent API
    • setRate

      public RatePlanner setRate(double fromTime, double rate)
      Deprecated.
      Sets the rate from the specified time till the time of Double.POSITIVE_INFINITY. Erases all rates after the specified time and replaces them with the specified rate.
      Parameters:
      fromTime - time from which the new rate is set
      rate - new rate being set
      Returns:
      reference to this instance, for support of fluent API
    • addRate

      public RatePlanner addRate(double fromTime, double toTime, double rateDelta)
      Deprecated.
      Adds the specified rate delta (positive or negative) to all rates between the specified begin and end times. All rates in the specified time period will be changed by the specified rate delta.

      All rates outside the specified time period will remain unchanged.

      Parameters:
      fromTime - begin time of the specified period
      toTime - begin time of the specified period
      rateDelta - specified rate delta
      Returns:
      reference to this instance, for support of fluent API
    • addRate

      public RatePlanner addRate(double fromTime, double rateDelta)
      Deprecated.
      Adds the specified rate delta (positive or negative) to all rates starting at the specified time onwards to the time of Double.POSITIVE_INFINITY.
      Parameters:
      fromTime - time from which the rate is change
      rateDelta - rate that is added to all rates from the specified time
      Returns:
      reference to this instance, for support of fluent API
    • copy

      public RatePlanner copy()
      Deprecated.
      Returns a copy of this rate planner.
      Returns:
      copy of this rate planner
    • truncateAfter

      public RatePlanner truncateAfter(double afterTime)
      Deprecated.
      Returns a new instance of a RatePlanner with all step and rate changes after the specified time removed. The zero rate is set for the returned rate planner at the specified time. Quantity changes exactly at the specified time are retained.
      Parameters:
      afterTime - specified time
      Returns:
      new instance of a RatePlanner with all step and rate changes after the specified time removed.
    • plus

      public RatePlanner plus(RatePlanner otherRatePlanner)
      Deprecated.
      Returns a new instance of RatePlanner that is a sum of this rate planner and the other specified rate planner. Does not change this rate planner.
      Parameters:
      otherRatePlanner - other rate planner to be summed with this one.
      Returns:
      new instance of RatePlanner that is a sum of this rate planner and the other specified rate planner
    • minus

      public RatePlanner minus(RatePlanner otherRatePlanner)
      Deprecated.
      Returns a new instance of RatePlanner that is a difference of this rate planner and the other specified rate planner. Does not change this rate planner.
      Parameters:
      otherRatePlanner - other rate planner to be subtracted from this one.
      Returns:
      new instance of RatePlanner that is a difference of this rate planner and the other specified rate planner
    • integral

      public double integral(double beginTime, double endTime)
      Deprecated.
      Returns an integral of a piecewise linear function represented by this rate planner between the specified begin and end times. Integral value is equal to area under the plot of the function.

      Note that areas under the zero axis will come out negative and areas above the zero axis will be positive. Thus, negative areas, if any, will be subtracted from positive areas.

      Parameters:
      beginTime - begin time of integration
      endTime - end time of integration
      Returns:
      integral of a piecewise linear function represented by this rate planner between the specified begin and end times. Can be positive, zero, or negative
    • absoluteIntegral

      public double absoluteIntegral(double beginTime, double endTime)
      Deprecated.
      Returns an absolute integral of a piecewise linear function represented by this rate planner between the specified begin and end times. Integral value is equal to area under the plot of the function.

      Note that both areas under the zero axis will and areas above the zero axis will be counted positive. Thus, the result of this function is always non-negative.

      Parameters:
      beginTime - begin time of integration
      endTime - end time of integration
      Returns:
      absolute integral of a piecewise linear function represented by this rate planner between the specified begin and end times. Always non-negative
    • deficitQuantity

      public double deficitQuantity(double beginTime, double endTime)
      Deprecated.
      Returns the sum of absolute quantities that the function would have decreased by if it was unbounded during the deficit periods between the specified begin time and end time. If the lower bound is infinite, always returns zero.

      Deficit is a situation when both of the following conditions hold true:

      • quantity is less than or equal to the lower bound, and
      • rate is less than zero.
      Parameters:
      beginTime - begin time of the specified interval, can be Double.NEGATIVE_INFINITY
      endTime - begin time of the specified interval, can be Double.POSITIVE_INFINITY
      Returns:
      total absolute deficit quantity during between the specified begin and end times
      See Also:
    • overflowQuantity

      public double overflowQuantity(double beginTime, double endTime)
      Deprecated.
      Returns the sum of quantities that the function would have grown by if it was unbounded during the overflow periods between the specified begin time and end time. If the upper bound is infinite, always returns zero.

      Overflow is a situation when both of the following conditions hold true:

      • quantity is greater than or equal to the upper bound, and
      • rate is greater than zero.
      Parameters:
      beginTime - begin time of the specified interval, can be Double.NEGATIVE_INFINITY
      endTime - begin time of the specified interval, can be Double.POSITIVE_INFINITY
      Returns:
      total overflow quantity during between the specified begin and end times
      See Also:
    • totalGrowthQuantity

      public double totalGrowthQuantity(double beginTime, double endTime)
      Deprecated.
      Returns the total quantity by which the function would have grown during the specified interval as result of positive rates if it had been unbounded.

      Growth due to positive step changes is not included into the result of this method.

      Parameters:
      beginTime - begin time of the specified interval, can be Double.NEGATIVE_INFINITY
      endTime - begin time of the specified interval, can be Double.POSITIVE_INFINITY
      Returns:
      total quantity by which the function would have grown during the specified interval
    • totalDecreaseQuantity

      public double totalDecreaseQuantity(double beginTime, double endTime)
      Deprecated.
      Returns the absolute total quantity by which the function would have decreased during the specified interval as result of negative rates if it had been unbounded.

      Growth due to negative step changes is not included into the result of this method.

      The result returned by this function is greater than or equal to zero.

      Parameters:
      beginTime - begin time of the specified interval, can be Double.NEGATIVE_INFINITY
      endTime - begin time of the specified interval, can be Double.POSITIVE_INFINITY
      Returns:
      absolute total quantity by which the function would have decreased during the specified interval as result of negative rates
    • durationWithQuantityMoreThan

      public double durationWithQuantityMoreThan(double beginTime, double endTime, double quantity)
      Deprecated.
      Returns the total duration of all periods between the specified begin and end times when the quantity was greater than the specified value.
      Parameters:
      beginTime - begin time of the specified period
      endTime - end time of the specified period
      quantity - the quantity must be greater than this value
      Returns:
      total duration of all periods between the specified begin and end times when the quantity was greater than the specified value. Non-negative number
    • durationWithQuantityMoreEqualThan

      public double durationWithQuantityMoreEqualThan(double beginTime, double endTime, double quantity)
      Deprecated.
      Returns the total duration of all periods between the specified begin and end times when the quantity was greater than or equal to the specified value.
      Parameters:
      beginTime - begin time of the specified period
      endTime - end time of the specified period
      quantity - the quantity must be greater than or equal to this value
      Returns:
      total duration of all periods between the specified begin and end times when the quantity was greater than or equal to the specified value. Non-negative number
    • periodsWithRateLessThan

      public List<Pair<Double,Double>> periodsWithRateLessThan(double lessThanRate)
      Deprecated.
      Returns the list of time intervals when the rate is less than the specified value. The time intervals in the returned list are represented with Pair-s of double values containing begin and end times of each corresponding interval. The intervals are ordered by begin time in ascending order.
      Returns:
      list of time intervals when the rate is less than the specified value
    • periodsWithRateMoreThan

      public List<Pair<Double,Double>> periodsWithRateMoreThan(double greaterThanRate)
      Deprecated.
      Returns the list of time intervals when the rate is greater than the specified value. The time intervals in the returned list are represented with Pair-s of double values containing begin and end times of each corresponding interval. The intervals are ordered by begin time in ascending order.
      Returns:
      list of time intervals when the rate is greater than the specified value
    • durationAboveZero

      @Deprecated(forRemoval=true) public double durationAboveZero(double beginTime, double endTime)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • durationNonNegative

      @Deprecated(forRemoval=true) public double durationNonNegative(double beginTime, double endTime)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getShifted

      public RatePlanner getShifted(double horizontalShift)
      Deprecated.
      Returns a new rate planner that is equal to this rate planner shifted horizontally by the specified value. The specified value can be both positive and negative.
      Parameters:
      horizontalShift - the returned rate planned will be shifted horizontally by this value
      Returns:
      new rate planner that is equal to this rate planner shifted horizontally by the specified value
    • toCodeString

      public String toCodeString()
      Deprecated.
      Returns a string representing Java code that creates this rate planner in its current state.
      Returns:
      Java code required to create this rate planner in its current state
    • of

      public static RatePlanner of(TimeStatistics timeStatistics)
      Deprecated.
      Creates a new instance of RatePlanner based on the data from the specified TimeStatistics instance.
      Parameters:
      timeStatistics - specified time statistics instance
      Returns:
      new instance based on the data from the specified TimeStatistics instance
    • of

      public static RatePlanner of(TimeStatistics timeStatistics, boolean cumulative)
      Deprecated.
      Creates a new instance of RatePlanner based on the data from the specified TimeStatistics instance.
      Parameters:
      timeStatistics - specified time statistics instance
      cumulative - if true, then the returned rate planner will contain cumulative data from the time statistics
      Returns:
      new instance based on the data from the specified TimeStatistics instance
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object