nextLeaving function

Requirements.Internal.SlidingWindow.nextLeaving  ยท source

Icon of nextLeaving

Return time instant when the oldest element is leaving the buffer

Extends Modelica.Icons.Function

Returns the instant at which the oldest element of the buffer leaves the sliding time window, buffer.t[buffer.last] + T. If the buffer is empty, it returns t - 2*T, an instant in the past, so that the condition time >= pre(t_next) of the caller does not become true again until the next element is stored. The counting checks of ChecksInSlidingWindow (e.g. MinRising) store it as t_next after every update and call removeOldest at that instant.

Inputs

NameTypeDescription
buffer inputBufferMemory of sliding window
t inputRealActual time instant

Outputs

NameTypeDescription
t_next outputSI.TimeNext time instant where the oldest value (t,b) in the buffer is leaving the time window