#include <RateEstimator.h>
Inheritance diagram for oasys::RateEstimator:
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 |
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_.
double oasys::RateEstimator::rate | ( | ) | [inline] |
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_.
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] |
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().