Base class for device energy models. More...
#include <device-energy-model.h>
Public Types | |
typedef Callback< void, int > | ChangeStateCallback |
Public Member Functions | |
virtual void | SetNode (Ptr< Node > node)=0 |
Sets pointer to node containing this EnergySource. | |
virtual Ptr< Node > | GetNode (void) const =0 |
Gets pointer to node containing this EnergySource. | |
virtual void | SetEnergySource (Ptr< EnergySource > source)=0 |
virtual double | GetTotalEnergyConsumption (void) const =0 |
virtual void | ChangeState (int newState)=0 |
double | GetCurrentA (void) const |
virtual void | HandleEnergyDepletion (void)=0 |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::DeviceEnergyModel. |
Base class for device energy models.
A device energy model should represent the energy consumption behavior of a specific device. It will update remaining energy stored in the EnergySource object installed on node. When energy is depleted, each DeviceEnergyModel object installed on the same node will be informed by the EnergySource.
typedef Callback<void, int> ns3::DeviceEnergyModel::ChangeStateCallback |
Callback type for ChangeState function. Devices uses this state to notify DeviceEnergyModel of a state change.
virtual void ns3::DeviceEnergyModel::ChangeState | ( | int | newState | ) | [pure virtual] |
newState | New state the device is in. |
DeviceEnergyModel is a state based model. This function is implemented by all child of DeviceEnergyModel to change the model's state. States are to be defined by each child using an enum (int).
Implemented in ns3::WifiRadioEnergyModel.
double ns3::DeviceEnergyModel::GetCurrentA | ( | void | ) | const |
This function returns the current draw at the device in its current state. This function is called from the EnergySource to obtain the total current draw at any given time during simulation.
Gets pointer to node containing this EnergySource.
Implemented in ns3::WifiRadioEnergyModel.
virtual double ns3::DeviceEnergyModel::GetTotalEnergyConsumption | ( | void | ) | const [pure virtual] |
DeviceEnergyModel records its own energy consumption during simulation.
Implemented in ns3::WifiRadioEnergyModel.
static TypeId ns3::DeviceEnergyModel::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::DeviceEnergyModel.
This object is accessible through the following paths with Config::Set and Config::Connect:
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Object.
Reimplemented in ns3::WifiRadioEnergyModel.
virtual void ns3::DeviceEnergyModel::HandleEnergyDepletion | ( | void | ) | [pure virtual] |
This function is called by the EnergySource object when energy stored in the energy source is depleted. Should be implemented by child classes.
Implemented in ns3::WifiRadioEnergyModel.
virtual void ns3::DeviceEnergyModel::SetEnergySource | ( | Ptr< EnergySource > | source | ) | [pure virtual] |
source | Pointer to energy source installed on node. |
This function sets the pointer to energy source installed on node. Should be called only by DeviceEnergyModel helper classes.
Implemented in ns3::WifiRadioEnergyModel.
Sets pointer to node containing this EnergySource.
node | Pointer to node containing this EnergySource. |
Implemented in ns3::WifiRadioEnergyModel.