A Discrete-Event Network Simulator
API
ns3::GenericBatteryModelHelper Class Reference

Creates and assign an assortment of BatteryModels to Nodes. More...

#include "generic-battery-model-helper.h"

+ Inheritance diagram for ns3::GenericBatteryModelHelper:
+ Collaboration diagram for ns3::GenericBatteryModelHelper:

Public Member Functions

 GenericBatteryModelHelper ()
 
 ~GenericBatteryModelHelper () override
 
Ptr< EnergySourceContainerInstall (NodeContainer c) const
 This function installs energy sources in a group of nodes in a node container. More...
 
EnergySourceContainer Install (NodeContainer c, BatteryModel bm) const
 This function installs energy sources in a group of nodes in a node container. More...
 
Ptr< EnergySourceInstall (Ptr< Node > node, BatteryModel bm) const
 This function installs an energy source (battery) into a node. More...
 
void Set (std::string name, const AttributeValue &v) override
 Sets one of the attributes of underlying EnergySource. More...
 
void SetCellPack (EnergySourceContainer energySourceContainer, uint8_t series, uint8_t parallel) const
 This function takes an existing energy source container and transform the values of each of its containing energy sources to form groups of connected identical cells. More...
 
void SetCellPack (Ptr< EnergySource > energySource, uint8_t series, uint8_t parallel) const
 This function takes an existing energy source and transform its values to form a group of connected identical cells. More...
 
- Public Member Functions inherited from ns3::EnergySourceHelper
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. More...
 

Private Member Functions

Ptr< EnergySourceDoInstall (Ptr< Node > node) const override
 Child classes of EnergySourceHelper only have to implement this function, to create and aggregate an EnergySource object onto a single node. More...
 

Private Attributes

ObjectFactory m_batteryModel
 The energy source (battery) used by this helper. More...
 

Detailed Description

Creates and assign an assortment of BatteryModels to Nodes.

Definition at line 36 of file generic-battery-model-helper.h.

Constructor & Destructor Documentation

◆ GenericBatteryModelHelper()

ns3::GenericBatteryModelHelper::GenericBatteryModelHelper ( )

Definition at line 25 of file generic-battery-model-helper.cc.

References m_batteryModel, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ ~GenericBatteryModelHelper()

ns3::GenericBatteryModelHelper::~GenericBatteryModelHelper ( )
override

Definition at line 30 of file generic-battery-model-helper.cc.

Member Function Documentation

◆ DoInstall()

Ptr< EnergySource > ns3::GenericBatteryModelHelper::DoInstall ( Ptr< Node node) const
overrideprivatevirtual

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.

Parameters
nodePointer to node where the energy source is to be installed.
Returns
Pointer to the created EnergySource.

Implements ns3::EnergySourceHelper.

Definition at line 41 of file generic-battery-model-helper.cc.

References ns3::ObjectFactory::Create(), m_batteryModel, and NS_ASSERT.

Referenced by Install().

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

◆ Install() [1/3]

Ptr< EnergySourceContainer > ns3::GenericBatteryModelHelper::Install ( NodeContainer  c) const

This function installs energy sources in a group of nodes in a node container.

An energy source (Li-Ion battery) with default values is used on each node.

Parameters
cThe node container
Returns
An EnergySourceContainer which contains all the EnergySources.

Definition at line 51 of file generic-battery-model-helper.cc.

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

Referenced by Install().

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

◆ Install() [2/3]

EnergySourceContainer ns3::GenericBatteryModelHelper::Install ( NodeContainer  c,
BatteryModel  bm 
) const

This function installs energy sources in a group of nodes in a node container.

Parameters
cThe node container.
bmThe battery model that will be install to the nodes in the node container.
Returns
An EnergySourceContainer which contains all the EnergySources.

Definition at line 90 of file generic-battery-model-helper.cc.

References ns3::EnergySourceContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().

+ Here is the call graph for this function:

◆ Install() [3/3]

Ptr< EnergySource > ns3::GenericBatteryModelHelper::Install ( Ptr< Node node,
BatteryModel  bm 
) const

This function installs an energy source (battery) into a node.

Parameters
nodeThe node object.
bmThe battery model that will be install to the node.
Returns
A pointer to the energy source object used.

Definition at line 62 of file generic-battery-model-helper.cc.

References ns3::ObjectFactory::Create(), ns3::g_batteryPreset, m_batteryModel, and NS_ASSERT.

+ Here is the call graph for this function:

◆ Set()

void ns3::GenericBatteryModelHelper::Set ( std::string  name,
const AttributeValue v 
)
overridevirtual

Sets one of the attributes of underlying EnergySource.

Parameters
nameName of attribute to set.
vValue of the attribute.

Implements ns3::EnergySourceHelper.

Definition at line 35 of file generic-battery-model-helper.cc.

References m_batteryModel, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ SetCellPack() [1/2]

void ns3::GenericBatteryModelHelper::SetCellPack ( EnergySourceContainer  energySourceContainer,
uint8_t  series,
uint8_t  parallel 
) const

This function takes an existing energy source container and transform the values of each of its containing energy sources to form groups of connected identical cells.

The values of the newly formed cell blocks for each energy source depends on the connection of the cells defined by the user (number of cells connected in series, number of cells connected in parallel).

Parameters
energySourceContainerThe energy source container used.
seriesThe number of cells connected in series.
parallelThe number of cells connected in parallel.

Definition at line 144 of file generic-battery-model-helper.cc.

References ns3::EnergySourceContainer::Begin(), ns3::EnergySourceContainer::End(), ns3::EnergySourceContainer::GetN(), NS_ASSERT_MSG, and SetCellPack().

+ Here is the call graph for this function:

◆ SetCellPack() [2/2]

void ns3::GenericBatteryModelHelper::SetCellPack ( Ptr< EnergySource energySource,
uint8_t  series,
uint8_t  parallel 
) const

This function takes an existing energy source and transform its values to form a group of connected identical cells.

The values of the newly formed cell block depends on the connection of the cells defined by the user (number of cells connected in series, number of cells connected in parallel).

Parameters
energySourceThe energy source used.
seriesThe number of cells connected in series.
parallelThe number of cells connected in parallel.

Definition at line 102 of file generic-battery-model-helper.cc.

References ns3::DoubleValue::Get(), NS_ASSERT, and NS_ASSERT_MSG.

Referenced by SetCellPack().

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

Member Data Documentation

◆ m_batteryModel

ObjectFactory ns3::GenericBatteryModelHelper::m_batteryModel
private

The energy source (battery) used by this helper.

Definition at line 119 of file generic-battery-model-helper.h.

Referenced by GenericBatteryModelHelper(), DoInstall(), Install(), and Set().


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