Creates and assign an assortment of BatteryModels to Nodes. More...
#include "generic-battery-model-helper.h"
Public Member Functions | |
GenericBatteryModelHelper () | |
~GenericBatteryModelHelper () override | |
Ptr< EnergySourceContainer > | Install (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< EnergySource > | Install (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< 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. More... | |
Private Attributes | |
ObjectFactory | m_batteryModel |
The energy source (battery) used by this helper. More... | |
Creates and assign an assortment of BatteryModels to Nodes.
Definition at line 36 of file generic-battery-model-helper.h.
ns3::GenericBatteryModelHelper::GenericBatteryModelHelper | ( | ) |
Definition at line 25 of file generic-battery-model-helper.cc.
References m_batteryModel, and ns3::ObjectFactory::SetTypeId().
|
override |
Definition at line 30 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 41 of file generic-battery-model-helper.cc.
References ns3::ObjectFactory::Create(), m_batteryModel, and NS_ASSERT.
Referenced by Install().
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.
c | The node container |
Definition at line 51 of file generic-battery-model-helper.cc.
References ns3::NodeContainer::Begin(), DoInstall(), and ns3::NodeContainer::End().
Referenced by Install().
EnergySourceContainer ns3::GenericBatteryModelHelper::Install | ( | NodeContainer | c, |
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 90 of file generic-battery-model-helper.cc.
References ns3::EnergySourceContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().
Ptr< EnergySource > ns3::GenericBatteryModelHelper::Install | ( | Ptr< Node > | node, |
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 62 of file generic-battery-model-helper.cc.
References ns3::ObjectFactory::Create(), ns3::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 35 of file generic-battery-model-helper.cc.
References m_batteryModel, and ns3::ObjectFactory::Set().
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).
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 144 of file generic-battery-model-helper.cc.
References ns3::EnergySourceContainer::Begin(), ns3::EnergySourceContainer::End(), ns3::EnergySourceContainer::GetN(), NS_ASSERT_MSG, and SetCellPack().
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).
energySource | The energy source used. |
series | The number of cells connected in series. |
parallel | The 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().
|
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().