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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
18
*/
19
20
#ifndef GENERIC_BATTERY_MODEL_HELPER_H_
21
#define GENERIC_BATTERY_MODEL_HELPER_H_
22
23
#include "
energy-model-helper.h
"
24
25
#include <ns3/generic-battery-model.h>
26
#include <ns3/node.h>
27
28
namespace
ns3
29
{
30
31
/**
32
* \ingroup energy
33
* \brief Creates and assign an assortment of BatteryModels to Nodes.
34
*
35
*/
36
class
GenericBatteryModelHelper
:
public
EnergySourceHelper
37
{
38
public
:
39
GenericBatteryModelHelper
();
40
~GenericBatteryModelHelper
()
override
;
41
42
/**
43
* Sets one of the attributes of underlying EnergySource.
44
*
45
* \param name Name of attribute to set.
46
* \param v Value of the attribute.
47
*/
48
void
Set
(std::string name,
const
AttributeValue
& v)
override
;
49
50
/**
51
* This function installs energy sources in a group of nodes in a
52
* node container. An energy source (Li-Ion battery) with default values
53
* is used on each node.
54
*
55
* \param c The node container
56
* \returns An EnergySourceContainer which contains all the EnergySources.
57
*/
58
Ptr<energy::EnergySourceContainer>
Install
(
NodeContainer
c)
const
;
59
60
/**
61
* This function installs an energy source (battery) into a node.
62
*
63
* \param node The node object.
64
* \param bm The battery model that will be install to the node.
65
* \returns A pointer to the energy source object used.
66
*/
67
Ptr<energy::EnergySource>
Install
(
Ptr<Node>
node,
energy::BatteryModel
bm)
const
;
68
69
/**
70
* This function installs energy sources in a group of nodes in a
71
* node container.
72
*
73
* \param c The node container.
74
* \param bm The battery model that will be install to the nodes in the node container.
75
* \returns An EnergySourceContainer which contains all the EnergySources.
76
*/
77
energy::EnergySourceContainer
Install
(
NodeContainer
c,
energy::BatteryModel
bm)
const
;
78
79
/**
80
* This function takes an existing energy source and transform its values to form
81
* a group of connected identical cells. The values of the newly formed cell block
82
* depends on the connection of the cells defined by the user
83
* (number of cells connected in series, number of cells connected in parallel).
84
*
85
* \param energySource The energy source used.
86
* \param series The number of cells connected in series.
87
* \param parallel The number of cells connected in parallel.
88
*/
89
void
SetCellPack
(
Ptr<energy::EnergySource>
energySource,
90
uint8_t series,
91
uint8_t parallel)
const
;
92
93
/**
94
* This function takes an existing energy source container and transform the values
95
* of each of its containing energy sources to form groups of connected identical cells.
96
* The values of the newly formed cell blocks for each energy source
97
* depends on the connection of the cells defined by the user
98
* (number of cells connected in series, number of cells connected in parallel).
99
*
100
* \param energySourceContainer The energy source container used.
101
* \param series The number of cells connected in series.
102
* \param parallel The number of cells connected in parallel.
103
*/
104
void
SetCellPack
(
energy::EnergySourceContainer
energySourceContainer,
105
uint8_t series,
106
uint8_t parallel)
const
;
107
108
private
:
109
/**
110
* Child classes of EnergySourceHelper only have to implement this function,
111
* to create and aggregate an EnergySource object onto a single node. Rest of
112
* the installation process (eg. installing EnergySource on set of nodes) is
113
* implemented in the EnergySourceHelper base class.
114
*
115
* \param node Pointer to node where the energy source is to be installed.
116
* \returns Pointer to the created EnergySource.
117
*/
118
Ptr<energy::EnergySource>
DoInstall
(
Ptr<Node>
node)
const override
;
119
120
private
:
121
ObjectFactory
m_batteryModel
;
//!< The energy source (battery) used by this helper.
122
};
123
124
}
// namespace ns3
125
126
#endif
/* GENERIC_BATTERY_MODEL_HELPER_H_ */
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::EnergySourceHelper
Creates EnergySource objects.
Definition:
energy-model-helper.h:47
ns3::GenericBatteryModelHelper
Creates and assign an assortment of BatteryModels to Nodes.
Definition:
generic-battery-model-helper.h:37
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:35
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:105
ns3::GenericBatteryModelHelper::m_batteryModel
ObjectFactory m_batteryModel
The energy source (battery) used by this helper.
Definition:
generic-battery-model-helper.h:121
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:41
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:51
ns3::GenericBatteryModelHelper::~GenericBatteryModelHelper
~GenericBatteryModelHelper() override
Definition:
generic-battery-model-helper.cc:30
ns3::GenericBatteryModelHelper::GenericBatteryModelHelper
GenericBatteryModelHelper()
Definition:
generic-battery-model-helper.cc:25
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::energy::EnergySourceContainer
Holds a vector of ns3::EnergySource pointers.
Definition:
energy-source-container.h:48
energy-model-helper.h
ns3::energy::BatteryModel
BatteryModel
Battery models that described the parameters of the the battery presets.
Definition:
generic-battery-model.h:57
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
energy
helper
generic-battery-model-helper.h
Generated on Tue May 28 2024 23:35:17 for ns-3 by
1.9.6