PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
Battery Class Reference

Public Member Functions

Construction
 Battery ()
 
Battery Interface

@TODO Document these functions.

void SetValues (double _max, double _cur)
 
void SetToMax ()
 Set current level to max.
 
void Print ()
 Print current and max battery levels.
 
double GetCurLevel ()
 Get current battery level.
 
double GetMaxLevel ()
 Get max charge battery can hold.
 
void Charge (double _increaseRate)
 
void UpdateValue (double _depletionRateBase, double _depletionRateMoving)
 
void UpdateValue (double _depletionRateBase)
 

Protected Attributes

Internal State
double m_maxLevel
 Maximum charge the battery can hold.
 
double m_curLevel
 Current charge in the battery.
 

Detailed Description

Models a simulated battery with a finite amount of charge.

@TODO Unify with other hardware code. We want a general 'battery' base class which could represent either a real or simulated battery. This should be derived to describe either option.

Member Function Documentation

◆ SetValues()

void Battery::SetValues ( double  _max,
double  _cur 
)

Set max and current values of the battery

Parameters
_maxMax charge battery can hold
_curCurrent charge

◆ Charge()

void Battery::Charge ( double  _increaseRate)

Increase charge of battery, stop if over max

Parameters
_increaseRateAmount to increase the current charge by

◆ UpdateValue() [1/2]

void Battery::UpdateValue ( double  _depletionRateBase,
double  _depletionRateMoving 
)

Reduce value of charge by sum of base and moving rates

Parameters
_depletionRateBaseBase depletion rate of charge
_depletionRateMovingDepletion rate of charge while moving

◆ UpdateValue() [2/2]

void Battery::UpdateValue ( double  _depletionRateBase)

Reduce value of charge by base depletion rate

Parameters
_depletionRateBaseBase depletion rate of charge

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