Creates DeviceEnergyModel objects. More...
#include "energy-model-helper.h"
Public Member Functions | |
virtual | ~DeviceEnergyModelHelper () |
energy::DeviceEnergyModelContainer | Install (NetDeviceContainer deviceContainer, energy::EnergySourceContainer sourceContainer) const |
energy::DeviceEnergyModelContainer | Install (Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const |
virtual void | Set (std::string name, const AttributeValue &v)=0 |
Private Member Functions | |
virtual Ptr< energy::DeviceEnergyModel > | DoInstall (Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const =0 |
Creates DeviceEnergyModel objects.
This class helps to create and install DeviceEnergyModel onto NetDevice. A DeviceEnergyModel is connected to a NetDevice (or PHY object) by callbacks. Note that DeviceEnergyModel objects are not aggregated onto the node. They can be accessed through the EnergySource object, which is aggregated onto the node.
Definition at line 103 of file energy-model-helper.h.
|
virtual |
Definition at line 76 of file energy-model-helper.cc.
|
privatepure virtual |
device | The net device corresponding to DeviceEnergyModel object. |
source | The EnergySource the DeviceEnergyModel will be using. |
Child classes of DeviceEnergyModelHelper only have to implement this function, to create and aggregate an DeviceEnergyModel object onto a single node. The rest of the installation process (eg. installing EnergySource on set of nodes) is implemented in the DeviceEnergyModelHelper base class.
Implemented in ns3::AcousticModemEnergyModelHelper, ns3::lorawan::LoraRadioEnergyModelHelper, and ns3::WifiRadioEnergyModelHelper.
Referenced by Install(), and Install().
energy::DeviceEnergyModelContainer ns3::DeviceEnergyModelHelper::Install | ( | NetDeviceContainer | deviceContainer, |
energy::EnergySourceContainer | sourceContainer ) const |
deviceContainer | List of NetDevices to be install DeviceEnergyModel objects. |
sourceContainer | List of EnergySource the DeviceEnergyModel will be using. |
Installs DeviceEnergyModels with specified EnergySources onto a list of NetDevices.
Definition at line 92 of file energy-model-helper.cc.
References ns3::energy::EnergySourceContainer::Begin(), ns3::NetDeviceContainer::Begin(), DoInstall(), ns3::NetDeviceContainer::End(), ns3::energy::EnergySourceContainer::GetN(), ns3::NetDeviceContainer::GetN(), and NS_ASSERT.
energy::DeviceEnergyModelContainer ns3::DeviceEnergyModelHelper::Install | ( | Ptr< NetDevice > | device, |
Ptr< energy::EnergySource > | source ) const |
device | Pointer to the NetDevice to install DeviceEnergyModel. |
source | The EnergySource the DeviceEnergyModel will be using. |
Installs an DeviceEnergyModel with a specified EnergySource onto a xNetDevice.
Definition at line 81 of file energy-model-helper.cc.
References DoInstall(), and NS_ASSERT.
Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), AcousticModemEnergyDepletionTestCase::DoRun(), AcousticModemEnergyTestCase::DoRun(), UanExperiment::SetupCommunications(), and BatteryLifetimeTest::VariableLoadTest().
|
pure virtual |
name | Name of attribute to set. |
v | Value of the attribute. |
Sets one of the attributes of underlying DeviceEnergyModel.
Implemented in ns3::AcousticModemEnergyModelHelper, ns3::lorawan::LoraRadioEnergyModelHelper, and ns3::WifiRadioEnergyModelHelper.