A Discrete-Event Network Simulator
API
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 
37 {
38  public:
40  ~GenericBatteryModelHelper() override;
41 
48  void Set(std::string name, const AttributeValue& v) override;
49 
59 
68 
78 
89  void SetCellPack(Ptr<EnergySource> energySource, uint8_t series, uint8_t parallel) const;
90 
102  void SetCellPack(EnergySourceContainer energySourceContainer,
103  uint8_t series,
104  uint8_t parallel) const;
105 
106  private:
116  Ptr<EnergySource> DoInstall(Ptr<Node> node) const override;
117 
118  private:
120 };
121 
122 } // namespace ns3
123 
124 #endif /* GENERIC_BATTERY_MODEL_HELPER_H_ */
Hold a value for an Attribute.
Definition: attribute.h:70
Holds a vector of ns3::EnergySource pointers.
Creates EnergySource objects.
Creates and assign an assortment of BatteryModels to Nodes.
Ptr< EnergySource > DoInstall(Ptr< Node > node) const override
Child classes of EnergySourceHelper only have to implement this function, to create and aggregate an ...
void Set(std::string name, const AttributeValue &v) override
Sets one of the attributes of underlying EnergySource.
ObjectFactory m_batteryModel
The energy source (battery) used by this helper.
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 i...
Ptr< EnergySourceContainer > Install(NodeContainer c) const
This function installs energy sources in a group of nodes in a node container.
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
BatteryModel
Battery models that described the parameters of the the battery presets.
Every class exported by the ns3 library is enclosed in the ns3 namespace.