Returns the accumulated duration where buffer value is true in the sliding time window
function accumulatedDuration input Buffer buffer "Memory of sliding window"; input Modelica.SIunits.Time t "Actual time instant"; input Boolean b = false "Actual value at t (used if no element is in the buffer)"; output Modelica.SIunits.Time duration "Accumulated duration where buffer value is true in window"; end accumulatedDuration;