oasys::RateEstimator Class Reference

#include <RateEstimator.h>

Inheritance diagram for oasys::RateEstimator:

oasys::Timer

List of all members.


Detailed Description

Simple rate estimation class that does a weighted filter of samples.

Definition at line 30 of file RateEstimator.h.


Public Member Functions

 RateEstimator (int *var, int interval, double weight=0.125)
double rate ()
virtual void timeout (struct timeval *now)

Protected Attributes

int * var_
 variable being estimated
double rate_
 the estimated rate
int lastval_
 last sample value
int interval_
 timer interval (ms)
timeval lastts_
 last sample timestamp
double weight_
 weighting factor for sample decay

Constructor & Destructor Documentation

oasys::RateEstimator::RateEstimator ( int *  var,
int  interval,
double  weight = 0.125 
)

Definition at line 22 of file RateEstimator.cc.

References lastts_, lastval_, rate_, oasys::Timer::schedule_in(), var_, and weight_.


Member Function Documentation

double oasys::RateEstimator::rate (  )  [inline]

Definition at line 33 of file RateEstimator.h.

References rate_.

void oasys::RateEstimator::timeout ( struct timeval *  now  )  [virtual]

Definition at line 35 of file RateEstimator.cc.

References interval_, lastts_, lastval_, rate_, oasys::Timer::schedule_in(), TIMEVAL_DIFF_DOUBLE, var_, and weight_.


Member Data Documentation

int* oasys::RateEstimator::var_ [protected]

variable being estimated

Definition at line 37 of file RateEstimator.h.

Referenced by RateEstimator(), and timeout().

double oasys::RateEstimator::rate_ [protected]

the estimated rate

Definition at line 38 of file RateEstimator.h.

Referenced by rate(), RateEstimator(), and timeout().

int oasys::RateEstimator::lastval_ [protected]

last sample value

Definition at line 39 of file RateEstimator.h.

Referenced by RateEstimator(), and timeout().

int oasys::RateEstimator::interval_ [protected]

timer interval (ms)

Definition at line 40 of file RateEstimator.h.

Referenced by timeout().

timeval oasys::RateEstimator::lastts_ [protected]

last sample timestamp

Definition at line 41 of file RateEstimator.h.

Referenced by RateEstimator(), and timeout().

double oasys::RateEstimator::weight_ [protected]

weighting factor for sample decay

Definition at line 42 of file RateEstimator.h.

Referenced by RateEstimator(), and timeout().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:56 2007 for DTN Reference Implementation by  doxygen 1.5.3