Homepage Demos Overview Downloads Tutorials Reference
Credits

SmoothCompareTrans< T > Class Template Reference

#include <SmoothCompareTrans.h>

Inheritance diagram for SmoothCompareTrans< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class SmoothCompareTrans< T >

A subclass of CompareTrans, which provides monitoring of exponentially weighted averages to a threshold.

Has the additional requirement that template types must supply operator*=(float) and operator+=(T) for the weighted average

The gamma parameter is how much to weight the preceeding value - 1 will cause it to never update, 0 will cause it to only look at most recent. So, the lower the value, the faster it is to switch, but more prone to noise

Definition at line 15 of file SmoothCompareTrans.h.

Public Member Functions

 SmoothCompareTrans (StateNode *destination, const T *monitor, typename SmoothCompareTrans< T >::Test_t test, const T &value, const EventBase &poll, float gammap=0)
 constructor, see SmoothCompareTrans class notes for information
virtual void DoStart ()
 starts listening
void setBurnIn (unsigned int i)
 sets number of tests to perform before allowing a transition; default 1/(1-g)
unsigned int getBurnIn ()
 returns number of tests to perform before allowing a transition; default 1/(1-g)
virtual void processEvent (const EventBase &e)
 don't care about the event, just a pulse to check the values
virtual std::string getName () const
 Identifies the behavior in menus and such.

Protected Attributes

avg
 the current running average
const T * realmon
 pointer to the value being monitored
unsigned int burnin
 number of tests to perform before allowing a transition; default 1/(1-g)
unsigned int tests
 counter of tests made since last DoStart()
float g
 the gamma value controlling the exponential average, see the class documentation at the top

Private Member Functions

 SmoothCompareTrans (const SmoothCompareTrans &node)
 don't call this
SmoothCompareTrans operator= (const SmoothCompareTrans &node)
 don't call this


Constructor & Destructor Documentation

template<class T>
SmoothCompareTrans< T >::SmoothCompareTrans StateNode destination,
const T *  monitor,
typename SmoothCompareTrans< T >::Test_t  test,
const T &  value,
const EventBase poll,
float  gammap = 0
[inline]
 

constructor, see SmoothCompareTrans class notes for information

Definition at line 18 of file SmoothCompareTrans.h.

template<class T>
SmoothCompareTrans< T >::SmoothCompareTrans const SmoothCompareTrans< T > &  node  )  [private]
 

don't call this


Member Function Documentation

template<class T>
virtual void SmoothCompareTrans< T >::DoStart  )  [inline, virtual]
 

starts listening

Reimplemented from CompareTrans< T >.

Definition at line 23 of file SmoothCompareTrans.h.

template<class T>
unsigned int SmoothCompareTrans< T >::getBurnIn  )  [inline]
 

returns number of tests to perform before allowing a transition; default 1/(1-g)

Definition at line 35 of file SmoothCompareTrans.h.

template<class T>
virtual std::string SmoothCompareTrans< T >::getName  )  const [inline, virtual]
 

Identifies the behavior in menus and such.

Reimplemented from CompareTrans< T >.

Definition at line 50 of file SmoothCompareTrans.h.

template<class T>
SmoothCompareTrans SmoothCompareTrans< T >::operator= const SmoothCompareTrans< T > &  node  )  [private]
 

don't call this

template<class T>
virtual void SmoothCompareTrans< T >::processEvent const EventBase e  )  [inline, virtual]
 

don't care about the event, just a pulse to check the values

Reimplemented from CompareTrans< T >.

Definition at line 40 of file SmoothCompareTrans.h.

template<class T>
void SmoothCompareTrans< T >::setBurnIn unsigned int  i  )  [inline]
 

sets number of tests to perform before allowing a transition; default 1/(1-g)

Definition at line 30 of file SmoothCompareTrans.h.


Member Data Documentation

template<class T>
T SmoothCompareTrans< T >::avg [protected]
 

the current running average

Definition at line 53 of file SmoothCompareTrans.h.

Referenced by SmoothCompareTrans< T >::DoStart(), SmoothCompareTrans< T >::processEvent(), and SmoothCompareTrans< T >::SmoothCompareTrans().

template<class T>
unsigned int SmoothCompareTrans< T >::burnin [protected]
 

number of tests to perform before allowing a transition; default 1/(1-g)

Definition at line 56 of file SmoothCompareTrans.h.

Referenced by SmoothCompareTrans< T >::setBurnIn(), and SmoothCompareTrans< T >::SmoothCompareTrans().

template<class T>
float SmoothCompareTrans< T >::g [protected]
 

the gamma value controlling the exponential average, see the class documentation at the top

Definition at line 60 of file SmoothCompareTrans.h.

Referenced by SmoothCompareTrans< T >::SmoothCompareTrans().

template<class T>
const T* SmoothCompareTrans< T >::realmon [protected]
 

pointer to the value being monitored

Definition at line 54 of file SmoothCompareTrans.h.

Referenced by SmoothCompareTrans< T >::processEvent(), and SmoothCompareTrans< T >::SmoothCompareTrans().

template<class T>
unsigned int SmoothCompareTrans< T >::tests [protected]
 

counter of tests made since last DoStart()

Definition at line 57 of file SmoothCompareTrans.h.

Referenced by SmoothCompareTrans< T >::DoStart(), SmoothCompareTrans< T >::processEvent(), and SmoothCompareTrans< T >::SmoothCompareTrans().


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

Tekkotsu v2.2
Generated Tue Oct 19 14:20:23 2004 by Doxygen 1.3.9.1