A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
generic-battery-model-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Tokushima University, Japan.
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
7
*/
8
9
#ifndef GENERIC_BATTERY_MODEL_HELPER_H_
10
#define GENERIC_BATTERY_MODEL_HELPER_H_
11
12
#include "
energy-model-helper.h
"
13
14
#include <ns3/generic-battery-model.h>
15
#include <ns3/node.h>
16
17
namespace
ns3
18
{
19
20
/**
21
* \ingroup energy
22
* \brief Creates and assign an assortment of BatteryModels to Nodes.
23
*
24
*/
25
class
GenericBatteryModelHelper
:
public
EnergySourceHelper
26
{
27
public
:
28
GenericBatteryModelHelper
();
29
~GenericBatteryModelHelper
()
override
;
30
31
/**
32
* Sets one of the attributes of underlying EnergySource.
33
*
34
* \param name Name of attribute to set.
35
* \param v Value of the attribute.
36
*/
37
void
Set
(std::string name,
const
AttributeValue
& v)
override
;
38
39
/**
40
* This function installs energy sources in a group of nodes in a
41
* node container. An energy source (Li-Ion battery) with default values
42
* is used on each node.
43
*
44
* \param c The node container
45
* \returns An EnergySourceContainer which contains all the EnergySources.
46
*/
47
Ptr<energy::EnergySourceContainer>
Install
(
NodeContainer
c)
const
;
48
49
/**
50
* This function installs an energy source (battery) into a node.
51
*
52
* \param node The node object.
53
* \param bm The battery model that will be install to the node.
54
* \returns A pointer to the energy source object used.
55
*/
56
Ptr<energy::EnergySource>
Install
(
Ptr<Node>
node,
energy::BatteryModel
bm)
const
;
57
58
/**
59
* This function installs energy sources in a group of nodes in a
60
* node container.
61
*
62
* \param c The node container.
63
* \param bm The battery model that will be install to the nodes in the node container.
64
* \returns An EnergySourceContainer which contains all the EnergySources.
65
*/
66
energy::EnergySourceContainer
Install
(
NodeContainer
c,
energy::BatteryModel
bm)
const
;
67
68
/**
69
* This function takes an existing energy source and transform its values to form
70
* a group of connected identical cells. The values of the newly formed cell block
71
* depends on the connection of the cells defined by the user
72
* (number of cells connected in series, number of cells connected in parallel).
73
*
74
* \param energySource The energy source used.
75
* \param series The number of cells connected in series.
76
* \param parallel The number of cells connected in parallel.
77
*/
78
void
SetCellPack
(
Ptr<energy::EnergySource>
energySource,
79
uint8_t series,
80
uint8_t parallel)
const
;
81
82
/**
83
* This function takes an existing energy source container and transform the values
84
* of each of its containing energy sources to form groups of connected identical cells.
85
* The values of the newly formed cell blocks for each energy source
86
* depends on the connection of the cells defined by the user
87
* (number of cells connected in series, number of cells connected in parallel).
88
*
89
* \param energySourceContainer The energy source container used.
90
* \param series The number of cells connected in series.
91
* \param parallel The number of cells connected in parallel.
92
*/
93
void
SetCellPack
(
energy::EnergySourceContainer
energySourceContainer,
94
uint8_t series,
95
uint8_t parallel)
const
;
96
97
private
:
98
/**
99
* Child classes of EnergySourceHelper only have to implement this function,
100
* to create and aggregate an EnergySource object onto a single node. Rest of
101
* the installation process (eg. installing EnergySource on set of nodes) is
102
* implemented in the EnergySourceHelper base class.
103
*
104
* \param node Pointer to node where the energy source is to be installed.
105
* \returns Pointer to the created EnergySource.
106
*/
107
Ptr<energy::EnergySource>
DoInstall
(
Ptr<Node>
node)
const override
;
108
109
private
:
110
ObjectFactory
m_batteryModel
;
//!< The energy source (battery) used by this helper.
111
};
112
113
}
// namespace ns3
114
115
#endif
/* GENERIC_BATTERY_MODEL_HELPER_H_ */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::EnergySourceHelper
Creates EnergySource objects.
Definition
energy-model-helper.h:36
ns3::GenericBatteryModelHelper
Creates and assign an assortment of BatteryModels to Nodes.
Definition
generic-battery-model-helper.h:26
ns3::GenericBatteryModelHelper::Set
void Set(std::string name, const AttributeValue &v) override
Sets one of the attributes of underlying EnergySource.
Definition
generic-battery-model-helper.cc:24
ns3::GenericBatteryModelHelper::SetCellPack
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 i...
Definition
generic-battery-model-helper.cc:94
ns3::GenericBatteryModelHelper::m_batteryModel
ObjectFactory m_batteryModel
The energy source (battery) used by this helper.
Definition
generic-battery-model-helper.h:110
ns3::GenericBatteryModelHelper::DoInstall
Ptr< energy::EnergySource > DoInstall(Ptr< Node > node) const override
Child classes of EnergySourceHelper only have to implement this function, to create and aggregate an ...
Definition
generic-battery-model-helper.cc:30
ns3::GenericBatteryModelHelper::Install
Ptr< energy::EnergySourceContainer > Install(NodeContainer c) const
This function installs energy sources in a group of nodes in a node container.
Definition
generic-battery-model-helper.cc:40
ns3::GenericBatteryModelHelper::~GenericBatteryModelHelper
~GenericBatteryModelHelper() override
Definition
generic-battery-model-helper.cc:19
ns3::GenericBatteryModelHelper::GenericBatteryModelHelper
GenericBatteryModelHelper()
Definition
generic-battery-model-helper.cc:14
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::energy::EnergySourceContainer
Holds a vector of ns3::EnergySource pointers.
Definition
energy-source-container.h:37
energy-model-helper.h
ns3::energy::BatteryModel
BatteryModel
Battery models that described the parameters of the the battery presets.
Definition
generic-battery-model.h:46
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
energy
helper
generic-battery-model-helper.h
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0