geopm 3.2.1.dev535+ga96c120fc
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
geopm::AvgAccumulatorImp Class Reference

#include <Accumulator.hpp>

Inheritance diagram for geopm::AvgAccumulatorImp:
Collaboration diagram for geopm::AvgAccumulatorImp:

Public Member Functions

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

Additional Inherited Members

Static Public Member Functions inherited from geopm::AvgAccumulator
static std::unique_ptr< AvgAccumulator > make_unique (void)
 Factory constructor.
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: