ns-3
ns3::DeviceEnergyModel Class Reference

Base class for device energy models. More...

#include <device-energy-model.h>

Inheritance diagram for ns3::DeviceEnergyModel:
Collaboration diagram for ns3::DeviceEnergyModel:

List of all members.

Public Types

typedef Callback< void, int > ChangeStateCallback

Public Member Functions

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
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::DeviceEnergyModel.

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
virtual void NotifyNewAggregate (void)
virtual void DoStart (void)
virtual void DoDispose (void)
 Object (const Object &o)

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:
newStateNew 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, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.

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 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, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.

TypeId ns3::DeviceEnergyModel::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::DeviceEnergyModel.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

Reimplemented in ns3::WifiRadioEnergyModel, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.

References ns3::TypeId::SetParent().

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, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.

virtual void ns3::DeviceEnergyModel::SetEnergySource ( Ptr< EnergySource source)
pure virtual
Parameters:
sourcePointer 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, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.


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