PiecewiseLinearRateFunction

Represents a piecewise linear rate function as a sequence of segments. The rate at the beginning of the segment can be different from the rate at the end of the segment, with a linear rate over the duration.

Uses the segments represented by the rate, duration pairs The rate array must be larger than the duration array, not null, and have at least 2 rates. Any rates rate0 beginning rate of segment 0, duration0 duration of segment 0 i >=1 ratei ending rate of segment i-1, beginning rate of segment i, durationi duration of segment i

Author

rossetti

Parameters

durations

the durations

rates

the rates

Constructors

Link copied to clipboard
constructor(durations: DoubleArray, rates: DoubleArray)

Properties

Link copied to clipboard

The function's lower limit on the cumulative rate range

Link copied to clipboard

The function's upper limit on the cumulative rate range

Link copied to clipboard
open override val durations: DoubleArray

Get the durations as an array

Link copied to clipboard
open override var maximumRate: Double

Gets the maximum value of the rate function over its time horizon

Link copied to clipboard
open override var minimumRate: Double

Gets the minimum value of the rate function over its time horizon

Link copied to clipboard
open override val rates: DoubleArray

Get the rates as an array

Link copied to clipboard
open override val timeRangeLowerLimit: Double

The function's lower limit on the time range

Link copied to clipboard
open override val timeRangeUpperLimit: Double

The function's upper limit on the time range

Functions

Link copied to clipboard
open operator override fun contains(time: Double): Boolean

Returns true if the supplied time is within the time range of the rate function

Link copied to clipboard
open override fun cumulativeRate(time: Double): Double

Returns the value of the cumulative rate function at the supplied time

Link copied to clipboard

Searches for the interval that the supplied cumulative rate falls within. Returns -1 if no interval is found

Link copied to clipboard
open override fun findTimeInterval(time: Double): Int

Searches for the interval that the supplied time falls within. Returns -1 if no interval is found

Link copied to clipboard

Returns a copy of the piecewise linear rate function

open override fun instance(factor: Double): PiecewiseLinearRateFunction

Returns a copy of the piecewise linear rate function with each rate multiplied by the addFactor

Link copied to clipboard
open override fun inverseCumulativeRate(rate: Double): Double

Returns the value of the inverse cumulative rate function at the supplied rate The value returned is interpreted as a time

Link copied to clipboard

Returns the number of segments

Link copied to clipboard
open override fun rate(time: Double): Double

Returns the rate for the supplied time

Link copied to clipboard

Returns the rate segment at index k Interval indexing starts at index 0 (i.e. 0 is the first interval, silly Java zero based indexing)

Link copied to clipboard
open override fun toString(): String