Public Types | Public Member Functions | Static Public Member Functions

ns3::DeviceEnergyModel Class Reference

Base class for device energy models. More...

#include <device-energy-model.h>

Inheritance diagram for ns3::DeviceEnergyModel:
Inheritance graph
[legend]
Collaboration diagram for ns3::DeviceEnergyModel:
Collaboration graph
[legend]

List of all members.

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< NodeGetNode (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.

Detailed Description

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.


Member Typedef Documentation

Callback type for ChangeState function. Devices uses this state to notify DeviceEnergyModel of a state change.


Member Function Documentation

virtual void ns3::DeviceEnergyModel::ChangeState ( int  newState  )  [pure virtual]
Parameters:
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
Returns:
Current draw of the device, in Ampere.

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.

virtual Ptr<Node> ns3::DeviceEnergyModel::GetNode ( void   )  const [pure virtual]

Gets pointer to node containing this EnergySource.

Returns:
Pointer to node containing this EnergySource.

Implemented in ns3::WifiRadioEnergyModel.

virtual double ns3::DeviceEnergyModel::GetTotalEnergyConsumption ( void   )  const [pure virtual]
Returns:
Total energy consumption of the device.

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:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/LinkManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/SSManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/Classifier/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/NoiseModel/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/PropagationModel/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Transducer/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/LinkManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/SSManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/Classifier/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BandwidthManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BurstProfileManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/NoiseModel/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/PropagationModel/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/ConnectionManager/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/NoiseModel/$ns3::DeviceEnergyModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/PropagationModel/$ns3::DeviceEnergyModel

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]
Parameters:
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.

virtual void ns3::DeviceEnergyModel::SetNode ( Ptr< Node node  )  [pure virtual]

Sets pointer to node containing this EnergySource.

Parameters:
node Pointer to node containing this EnergySource.

Implemented in ns3::WifiRadioEnergyModel.


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