rollingTrueDuration

fun rollingTrueDuration(range: Duration, unit: Duration): Real

Calculates the sum of durations of true segments in a range leading the current time.

This returns a real profile that equals, at each time t, the duration of true segments in the interval [t, t+range].

Real profiles can't actually represent durations, only unitless numbers, so the result is actually calculated as a multiple of the provided unit.

Because this is a serial profile, the duration of true segments in the look-ahead range can't exceed range itself. So the result is bounded by [0, range/unit]

Parameters

range

how far into the future to look

unit

the time basis vector of the result; the unit of time that the result counts.