ns-3
|
Base class for device energy models. More...
#include <device-energy-model.h>
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 |
![]() | |
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) |
![]() | |
SimpleRefCount (const SimpleRefCount &o) | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
uint32_t | GetReferenceCount (void) const |
![]() | |
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 | |
![]() | |
virtual void | NotifyNewAggregate (void) |
virtual void | DoStart (void) |
virtual void | DoDispose (void) |
Object (const Object &o) |
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.
|
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.
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.
|
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.
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.