A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::EnergySourceHelper Class Referenceabstract

Creates EnergySource objects. More...

#include "energy-model-helper.h"

+ Inheritance diagram for ns3::EnergySourceHelper:

Public Member Functions

virtual ~EnergySourceHelper ()
 
EnergySourceContainer Install (NodeContainer c) const
 
EnergySourceContainer Install (Ptr< Node > node) const
 
EnergySourceContainer Install (std::string nodeName) const
 
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< EnergySourceDoInstall (Ptr< Node > node) const =0
 

Detailed Description

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 46 of file energy-model-helper.h.

Constructor & Destructor Documentation

◆ ~EnergySourceHelper()

ns3::EnergySourceHelper::~EnergySourceHelper ( )
virtual

Definition at line 31 of file energy-model-helper.cc.

Member Function Documentation

◆ DoInstall()

virtual Ptr< EnergySource > ns3::EnergySourceHelper::DoInstall ( Ptr< Node node) const
privatepure virtual
Parameters
nodePointer to node where the energy source is to be installed.
Returns
Pointer to the created EnergySource.

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().

+ Here is the caller graph for this function:

◆ Install() [1/3]

EnergySourceContainer ns3::EnergySourceHelper::Install ( NodeContainer  c) const
Parameters
cList of nodes where EnergySource will be installed.
Returns
An EnergySourceContainer which contains all the EnergySources.

This function installs an EnergySource onto a list of nodes.

Definition at line 42 of file energy-model-helper.cc.

References ns3::NodeContainer::Begin(), ns3::ObjectFactory::Create(), DoInstall(), ns3::NodeContainer::End(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ Install() [2/3]

EnergySourceContainer ns3::EnergySourceHelper::Install ( Ptr< Node node) const
Parameters
nodePointer to the node where EnergySource will be installed.
Returns
An EnergySourceContainer which contains all the EnergySources.

This function installs an EnergySource onto a node.

Definition at line 36 of file energy-model-helper.cc.

References Install().

Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), AcousticModemEnergyTestCase::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), Install(), InstallAll(), UanExperiment::SetupEnergy(), and BatteryLifetimeTest::VariableLoadTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Install() [3/3]

EnergySourceContainer ns3::EnergySourceHelper::Install ( std::string  nodeName) const
Parameters
nodeNameName of node where EnergySource will be installed.
Returns
An EnergySourceContainer which contains all the EnergySources.

This function installs an EnergySource onto a node.

Definition at line 72 of file energy-model-helper.cc.

References Install().

+ Here is the call graph for this function:

◆ InstallAll()

EnergySourceContainer ns3::EnergySourceHelper::InstallAll ( ) const

This function installs an EnergySource on all nodes in simulation.

Returns
An EnergySourceContainer which contains all the EnergySources.

Definition at line 79 of file energy-model-helper.cc.

References ns3::NodeContainer::GetGlobal(), and Install().

+ Here is the call graph for this function:

◆ Set()

virtual void ns3::EnergySourceHelper::Set ( std::string  name,
const AttributeValue v 
)
pure virtual
Parameters
nameName of attribute to set.
vValue of the attribute.

Sets one of the attributes of underlying EnergySource.

Implemented in ns3::BasicEnergySourceHelper, ns3::GenericBatteryModelHelper, ns3::LiIonEnergySourceHelper, and ns3::RvBatteryModelHelper.


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