Creates EnergySource objects. More...
#include "energy-model-helper.h"
Public Member Functions | |
virtual | ~EnergySourceHelper () |
energy::EnergySourceContainer | Install (NodeContainer c) const |
energy::EnergySourceContainer | Install (Ptr< Node > node) const |
energy::EnergySourceContainer | Install (std::string nodeName) const |
energy::EnergySourceContainer | InstallAll () const |
This function installs an EnergySource on all nodes in simulation. | |
virtual void | Set (std::string name, const AttributeValue &v)=0 |
Private Member Functions | |
virtual Ptr< energy::EnergySource > | DoInstall (Ptr< Node > node) const =0 |
Creates EnergySource objects.
This class creates and installs an energy source onto network nodes. Multiple sources can exist on a network node.
Definition at line 35 of file energy-model-helper.h.
|
virtual |
Definition at line 20 of file energy-model-helper.cc.
|
privatepure virtual |
node | Pointer to node where the energy source is to be installed. |
Child classes of EnergySourceHelper only have to implement this function, to create and aggregate an EnergySource object onto a single node. Rest of the installation process (eg. installing EnergySource on set of nodes) is implemented in the EnergySourceHelper base class.
Implemented in ns3::BasicEnergySourceHelper, ns3::GenericBatteryModelHelper, ns3::LiIonEnergySourceHelper, and ns3::RvBatteryModelHelper.
Referenced by Install().
energy::EnergySourceContainer ns3::EnergySourceHelper::Install | ( | NodeContainer | c | ) | const |
c | List of nodes where EnergySource will be installed. |
This function installs an EnergySource onto a list of nodes.
Definition at line 31 of file energy-model-helper.cc.
References ns3::NodeContainer::Begin(), ns3::ObjectFactory::Create(), DoInstall(), ns3::NodeContainer::End(), and ns3::ObjectFactory::SetTypeId().
energy::EnergySourceContainer ns3::EnergySourceHelper::Install | ( | Ptr< Node > | node | ) | const |
node | Pointer to the node where EnergySource will be installed. |
This function installs an EnergySource onto a node.
Definition at line 25 of file energy-model-helper.cc.
References Install().
Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), AcousticModemEnergyDepletionTestCase::DoRun(), AcousticModemEnergyTestCase::DoRun(), Install(), Install(), InstallAll(), UanExperiment::SetupEnergy(), and BatteryLifetimeTest::VariableLoadTest().
energy::EnergySourceContainer ns3::EnergySourceHelper::Install | ( | std::string | nodeName | ) | const |
nodeName | Name of node where EnergySource will be installed. |
This function installs an EnergySource onto a node.
Definition at line 61 of file energy-model-helper.cc.
References ns3::Names::Find(), and Install().
energy::EnergySourceContainer ns3::EnergySourceHelper::InstallAll | ( | ) | const |
This function installs an EnergySource on all nodes in simulation.
Definition at line 68 of file energy-model-helper.cc.
References ns3::NodeContainer::GetGlobal(), and Install().
|
pure virtual |
name | Name of attribute to set. |
v | Value of the attribute. |
Sets one of the attributes of underlying EnergySource.
Implemented in ns3::BasicEnergySourceHelper, ns3::GenericBatteryModelHelper, ns3::LiIonEnergySourceHelper, and ns3::RvBatteryModelHelper.