Creates and assign an assortment of BatteryModels to Nodes. More...
#include "generic-battery-model-helper.h"
Public Member Functions | |
GenericBatteryModelHelper () | |
~GenericBatteryModelHelper () override | |
Ptr< energy::EnergySourceContainer > | Install (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::EnergySource > | Install (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::EnergySource > | DoInstall (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. | |
Creates and assign an assortment of BatteryModels to Nodes.
Definition at line 25 of file generic-battery-model-helper.h.
ns3::GenericBatteryModelHelper::GenericBatteryModelHelper | ( | ) |
Definition at line 14 of file generic-battery-model-helper.cc.
References m_batteryModel, and ns3::ObjectFactory::SetTypeId().
|
override |
Definition at line 19 of file generic-battery-model-helper.cc.
|
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.
node | Pointer to node where the energy source is to be installed. |
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().
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.
c | The node container |
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().
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.
c | The node container. |
bm | The battery model that will be install to the nodes in the node container. |
Definition at line 82 of file generic-battery-model-helper.cc.
References ns3::energy::EnergySourceContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().
Ptr< energy::EnergySource > ns3::GenericBatteryModelHelper::Install | ( | Ptr< Node > | node, |
energy::BatteryModel | bm ) const |
This function installs an energy source (battery) into a node.
node | The node object. |
bm | The battery model that will be install to the node. |
Definition at line 52 of file generic-battery-model-helper.cc.
References ns3::ObjectFactory::Create(), ns3::energy::g_batteryPreset, m_batteryModel, and NS_ASSERT.
|
overridevirtual |
Sets one of the attributes of underlying EnergySource.
name | Name of attribute to set. |
v | Value of the attribute. |
Implements ns3::EnergySourceHelper.
Definition at line 24 of file generic-battery-model-helper.cc.
References m_batteryModel, and ns3::ObjectFactory::Set().
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).
energySourceContainer | The energy source container used. |
series | The number of cells connected in series. |
parallel | The 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().
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).
energySource | The energy source used. |
series | The number of cells connected in series. |
parallel | The 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().
|
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().