Buffer record
Requirements.Internal.SlidingWindow.Buffer
· source
Memory of sliding window
Extends Modelica.Icons.Record
The memory of a sliding time window of length T: a ring buffer of at most
nBuffer pairs (t[i], b[i]),
each the instant at which a Boolean signal changed and its value from then on. first is the index of
the newest element, last the index of the oldest one, nElem the number of elements
(first = last = 0 when the buffer is empty); the indices wrap around from nBuffer to 1.
t0 is the instant at which the window started (the start of the simulation), so that the time
before it is not counted. The record is created with init,
updated with push and
removeOldest, and read with the other
functions of SlidingWindow; its fields should not be
written directly.
Components and variables
| Name | Type | Description |
|---|---|---|
T | SI.Time | Length of sliding window |
t0 | SI.Time | Time instant where sliding time window starts |
t[…] | SI.Time | Time instants |
b[…] | Boolean | Values at corresponding time instants |
first | Integer | Index of first element in buffer |
last | Integer | Index of last element in buffer |
nElem | Integer | Number of elements in the buffer |