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

Simple moving average statistic. More...

#include <Statistic.h>

+ Inheritance diagram for agxUtil::MovingAverageStatistic:

Public Member Functions

 MovingAverageStatistic (size_t maxHistorySize)
 
virtual ~MovingAverageStatistic ()
 
virtual agx::Real get () const
 
virtual agx::Real update (agx::Real observation)
 Updates the statistic given the current observation and returns the current value of this statistic.
 
- 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)
 

Protected Attributes

size_t m_maxHistorySize
 
agx::RealVector m_values
 

Detailed Description

Simple moving average statistic.

Definition at line 286 of file Statistic.h.

Constructor & Destructor Documentation

◆ MovingAverageStatistic()

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

Definition at line 292 of file Statistic.h.

◆ ~MovingAverageStatistic()

virtual agxUtil::MovingAverageStatistic::~MovingAverageStatistic ( )
inlinevirtual

Definition at line 314 of file Statistic.h.

Member Function Documentation

◆ get()

virtual agx::Real agxUtil::MovingAverageStatistic::get ( ) const
inlinevirtual
Returns
the current value of this statistic

Implements agxUtil::Statistic.

Definition at line 305 of file Statistic.h.

◆ make_statistic()

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

Definition at line 316 of file Statistic.h.

◆ update()

virtual agx::Real agxUtil::MovingAverageStatistic::update ( agx::Real  observation)
inlinevirtual

Updates the statistic given the current observation and returns the current value of this statistic.

Parameters
observation- the current observation
Returns
the current value of this statistic

Implements agxUtil::Statistic.

Definition at line 295 of file Statistic.h.

Member Data Documentation

◆ m_maxHistorySize

size_t agxUtil::MovingAverageStatistic::m_maxHistorySize
protected

Definition at line 324 of file Statistic.h.

◆ m_values

agx::RealVector agxUtil::MovingAverageStatistic::m_values
protected

Definition at line 325 of file Statistic.h.


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