geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::AvgAccumulatorImp Class Reference

#include <Accumulator.hpp>

Inheritance diagram for geopm::AvgAccumulatorImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::AvgAccumulatorImp:
Collaboration graph
[legend]

Public Member Functions

 AvgAccumulatorImp ()
 
virtual ~AvgAccumulatorImp ()=default
 
void update (double delta_time, double signal) override
 Called in control loop to update state. More...
 
void enter (void) override
 Mark the beginning of an interval. More...
 
void exit (void) override
 Mark the end of an interval. More...
 
double average (void) const override
 Average of the signal tracked while the condition is true. More...
 
double interval_average (void) const override
 Average of the signal tracked while the condition is true. More...
 
- Public Member Functions inherited from geopm::AvgAccumulator
virtual ~AvgAccumulator ()=default
 Virtual destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::AvgAccumulator
static std::unique_ptr< AvgAccumulatormake_unique (void)
 Factory constructor. More...
 
- Protected Member Functions inherited from geopm::AvgAccumulator
 AvgAccumulator ()=default
 

Constructor & Destructor Documentation

◆ AvgAccumulatorImp()

geopm::AvgAccumulatorImp::AvgAccumulatorImp ( )

◆ ~AvgAccumulatorImp()

virtual geopm::AvgAccumulatorImp::~AvgAccumulatorImp ( )
virtualdefault

Member Function Documentation

◆ average()

double geopm::AvgAccumulatorImp::average ( void  ) const
overridevirtual

Average of the signal tracked while the condition is true.

Get the average value of the signal being tracked when the condition was true. This average is weighted by the duration of the control loop when each update() call was made.

Returns
Time weighted average of the signal being tracked while the condition is true.

Implements geopm::AvgAccumulator.

◆ enter()

void geopm::AvgAccumulatorImp::enter ( void  )
overridevirtual

Mark the beginning of an interval.

Used to mark the beginning of an interval used for the interval_average() reporting. The next call to exit() will close the interval and update the value returned by interval_average() to reflect the interval between the enter() and exit() calls.

Implements geopm::AvgAccumulator.

◆ exit()

void geopm::AvgAccumulatorImp::exit ( void  )
overridevirtual

Mark the end of an interval.

Used to mark the end of an interval that was previously started with a call to the enter() API. The call to exit() will update the value returned by interval_average() to reflect the interval since the enter() call.

Implements geopm::AvgAccumulator.

◆ interval_average()

double geopm::AvgAccumulatorImp::interval_average ( void  ) const
overridevirtual

Average of the signal tracked while the condition is true.

Get the average value of the signal being tracked when the condition was true over the last interval. This average is weighted by the duration of the control loop when each update() call was made, and limited to the updates() made during the last enter()/exit() interval.

Returns
Time weighted average of the signal being tracked while the condition is true over the last interval.

Implements geopm::AvgAccumulator.

◆ update()

void geopm::AvgAccumulatorImp::update ( double  delta_time,
double  signal 
)
overridevirtual

Called in control loop to update state.

Update with the time interval and the value of the signal being tracked. This is called once in each control interval where the condition is true. The change in the time is measured over the period of the last control interval.

Parameters
[in]delta_timeChange in the time over the control interval.
[in]signalValue of the signal being tracked.

Implements geopm::AvgAccumulator.


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