Sirikata
Public Member Functions | Private Attributes
Sirikata::EWA< ValType > Class Template Reference

EWA maintains an exponentially weighted average. More...

#include <EWA.hpp>

Collaboration diagram for Sirikata::EWA< ValType >:

List of all members.

Public Member Functions

 EWA (float alpha)
void sample (const ValType &_s)
ValType value () const

Private Attributes

float mAlpha
ValType mEWA

Detailed Description

template<typename ValType>
class Sirikata::EWA< ValType >

EWA maintains an exponentially weighted average.

At initialization the user specifies the alpha weight to be used and then adds samples using sample(). The current value can be read using the value() method.


Constructor & Destructor Documentation

template<typename ValType>
Sirikata::EWA< ValType >::EWA ( float  alpha) [inline]

Member Function Documentation

template<typename ValType>
void Sirikata::EWA< ValType >::sample ( const ValType &  _s) [inline]
template<typename ValType>
ValType Sirikata::EWA< ValType >::value ( ) const [inline]

Member Data Documentation

template<typename ValType>
float Sirikata::EWA< ValType >::mAlpha [private]
template<typename ValType>
ValType Sirikata::EWA< ValType >::mEWA [private]

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