AGX Dynamics 2.41.1.2
Loading...
Searching...
No Matches
agxUtil::MedianStatistic Class Reference

Median statistic that keeps a history of a number of observations and reports the median, i.e., middle element in sorted order, of that. More...

#include <Statistic.h>

+ Inheritance diagram for agxUtil::MedianStatistic:

Public Member Functions

 MedianStatistic (size_t maxHistorySize)
 
void clear ()
 
virtual agx::Real get () const override
 
size_t getCurrentHistorySize () const
 
const agx::RealVectorgetHistoryByAge () const
 
const agx::RealVectorgetHistoryByValue () const
 
size_t getMaxHistorySize () const
 
virtual agx::Real update (agx::Real observation) override
 Ad a new observation to the history, removing the oldest if the maximum history size has been reached.
 
- Public Member Functions inherited from agxUtil::Statistic
virtual ~Statistic ()
 
virtual agx::Real get () const =0
 
virtual agx::Real update (agx::Real observation)=0
 Updates the statistic given the current observation and returns the current value of this statistic.
 

Static Public Member Functions

static StatisticHandleRef make_statistic (size_t maxHistorySize)
 

Detailed Description

Median statistic that keeps a history of a number of observations and reports the median, i.e., middle element in sorted order, of that.

Definition at line 180 of file Statistic.h.

Constructor & Destructor Documentation

◆ MedianStatistic()

agxUtil::MedianStatistic::MedianStatistic ( size_t  maxHistorySize)
inline
Parameters
maxHistorySize- The number of observations to keep in the history.

Definition at line 186 of file Statistic.h.

Member Function Documentation

◆ clear()

void agxUtil::MedianStatistic::clear ( )
inline

Definition at line 238 of file Statistic.h.

◆ get()

virtual agx::Real agxUtil::MedianStatistic::get ( ) const
inlineoverridevirtual
Returns
The median of the history.

Implements agxUtil::Statistic.

Definition at line 196 of file Statistic.h.

◆ getCurrentHistorySize()

size_t agxUtil::MedianStatistic::getCurrentHistorySize ( ) const
inline

Definition at line 252 of file Statistic.h.

References agxAssert.

◆ getHistoryByAge()

const agx::RealVector & agxUtil::MedianStatistic::getHistoryByAge ( ) const
inline

Definition at line 260 of file Statistic.h.

◆ getHistoryByValue()

const agx::RealVector & agxUtil::MedianStatistic::getHistoryByValue ( ) const
inline

Definition at line 266 of file Statistic.h.

◆ getMaxHistorySize()

size_t agxUtil::MedianStatistic::getMaxHistorySize ( ) const
inline

Definition at line 245 of file Statistic.h.

◆ make_statistic()

static StatisticHandleRef agxUtil::MedianStatistic::make_statistic ( size_t  maxHistorySize)
inlinestatic

Definition at line 271 of file Statistic.h.

◆ update()

virtual agx::Real agxUtil::MedianStatistic::update ( agx::Real  observation)
inlineoverridevirtual

Ad a new observation to the history, removing the oldest if the maximum history size has been reached.

Implements agxUtil::Statistic.

Definition at line 219 of file Statistic.h.


The documentation for this class was generated from the following file: