A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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< energy::EnergySourceContainerInstall (NodeContainer c) const
 This function installs energy sources in a group of nodes in a node container.
 
energy::EnergySourceContainer Install (NodeContainer c, energy::BatteryModel bm) const
 This function installs energy sources in a group of nodes in a node container.
 
Ptr< energy::EnergySourceInstall (Ptr< Node > node, energy::BatteryModel bm) const
 This function installs an energy source (battery) into a node.
 
void Set (std::string name, const AttributeValue &v) override
 Sets one of the attributes of underlying EnergySource.
 
void SetCellPack (energy::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.
 
void SetCellPack (Ptr< energy::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.
 
- Public Member Functions inherited from ns3::EnergySourceHelper
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.
 

Private Member Functions

Ptr< energy::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.
 

Private Attributes

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

Detailed Description

Creates and assign an assortment of BatteryModels to Nodes.

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

Constructor & Destructor Documentation

◆ GenericBatteryModelHelper()

ns3::GenericBatteryModelHelper::GenericBatteryModelHelper ( )

Definition at line 14 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 19 of file generic-battery-model-helper.cc.

Member Function Documentation

◆ DoInstall()

Ptr< energy::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 30 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< energy::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 40 of file generic-battery-model-helper.cc.

References ns3::NodeContainer::Begin(), ns3::CreateObject(), 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]

energy::EnergySourceContainer ns3::GenericBatteryModelHelper::Install ( NodeContainer c,
energy::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 82 of file generic-battery-model-helper.cc.

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

+ Here is the call graph for this function:

◆ Install() [3/3]

Ptr< energy::EnergySource > ns3::GenericBatteryModelHelper::Install ( Ptr< Node > node,
energy::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 52 of file generic-battery-model-helper.cc.

References ns3::ObjectFactory::Create(), ns3::energy::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 24 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 ( energy::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 136 of file generic-battery-model-helper.cc.

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

+ Here is the call graph for this function:

◆ SetCellPack() [2/2]

void ns3::GenericBatteryModelHelper::SetCellPack ( Ptr< energy::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 94 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 110 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: