removeOldest function

Requirements.Internal.SlidingWindow.removeOldest  ยท source

Icon of removeOldest

Remove all elements from the buffer that are about to leave the sliding time window

Extends Modelica.Icons.Function

Removes from the buffer all elements, starting with the oldest one, whose time is at or before t - (1 - eps)*T (eps = 1000*Modelica.Constants.eps), i.e. that have left the sliding time window at the instant t, and returns the updated buffer; an emptied buffer gets first = last = 0. Unlike push it stores no new element. The counting blocks of ChecksInSlidingWindow (MinRising, MaxRising, BandRising, MaxFrequency, MaxRisingFrequency) call it at the time event nextLeaving announces, when the oldest element leaves the window, and then count the remaining elements with numberOfValues.

Inputs

NameTypeDescription
buffer inputBufferMemory of sliding window
t inputRealActual time instant

Outputs

NameTypeDescription
newBuffer outputBufferUpdated memory of sliding window