Base class for device energy models. More...
#include <device-energy-model.h>
Public Types | |
typedef Callback< void, int > | ChangeStateCallback |
Public Member Functions | |
DeviceEnergyModel () | |
virtual | ~DeviceEnergyModel () |
virtual void | ChangeState (int newState)=0 |
double | GetCurrentA (void) const |
virtual double | GetTotalEnergyConsumption (void) const =0 |
virtual void | HandleEnergyDepletion (void)=0 |
virtual void | SetEnergySource (Ptr< EnergySource > source)=0 |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
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. |
Private Member Functions | |
virtual double | DoGetCurrentA (void) const |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
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.
Definition at line 43 of file device-energy-model.h.
typedef Callback<void, int> ns3::DeviceEnergyModel::ChangeStateCallback |
Callback type for ChangeState function. Devices uses this state to notify DeviceEnergyModel of a state change.
Definition at line 50 of file device-energy-model.h.
ns3::DeviceEnergyModel::DeviceEnergyModel | ( | ) |
Definition at line 36 of file device-energy-model.cc.
|
virtual |
Definition at line 40 of file device-energy-model.cc.
|
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, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.
Referenced by ns3::AcousticModemEnergyModelHelper::DoInstall(), and ns3::WifiRadioEnergyModel::WifiRadioEnergyModel().
|
privatevirtual |
Child class does not have to implement this method if current draw for its states are not know. This default method will always return 0.0A. For the devices who does know the current draw of its states, this method must be overwritten.
Definition at line 55 of file device-energy-model.cc.
Referenced by GetCurrentA().
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.
Definition at line 45 of file device-energy-model.cc.
References DoGetCurrentA().
|
pure virtual |
DeviceEnergyModel records its own energy consumption during simulation.
Implemented in ns3::WifiRadioEnergyModel, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.
|
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.
Definition at line 28 of file device-energy-model.cc.
References ns3::TypeId::SetParent().
|
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.
|
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, ns3::AcousticModemEnergyModel, and ns3::SimpleDeviceEnergyModel.