|
Momentum Scripting v1
|
#include <Statistic.h>
Public Member Functions | |
| MedianStatistic (size_t maxHistorySize) | |
| void | clear () |
| virtual double | get () const override |
| size_t | getCurrentHistorySize () const |
| size_t | getMaxHistorySize () const |
| virtual double | update (double observation) override |
Median statistic that keeps a history of a number of observations and reports the median, i.e., middle element in sorted order, of that.
| v1::MedianStatistic::MedianStatistic | ( | size_t | maxHistorySize | ) |
| maxHistorySize | - The number of observations to keep in the history. |
| void v1::MedianStatistic::clear | ( | ) |
Reset all history.
|
overridevirtual |
| size_t v1::MedianStatistic::getCurrentHistorySize | ( | ) | const |
| size_t v1::MedianStatistic::getMaxHistorySize | ( | ) | const |
|
overridevirtual |
Add a new observation to the history, removing the oldest if the maximum history size has been reached.
| observation | - the observation to add |
Implements v1::Statistic.