A Discrete-Event Network Simulator
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
17namespace ns3
18{
19
20/**
21 * \ingroup energy
22 * \brief Creates and assign an assortment of BatteryModels to Nodes.
23 *
24 */
26{
27 public:
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 */
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 */
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 */
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_ */
Hold a value for an Attribute.
Definition attribute.h:59
Creates EnergySource objects.
Creates and assign an assortment of BatteryModels to Nodes.
void Set(std::string name, const AttributeValue &v) override
Sets one of the attributes of underlying EnergySource.
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...
ObjectFactory m_batteryModel
The energy source (battery) used by this helper.
Ptr< energy::EnergySource > DoInstall(Ptr< Node > node) const override
Child classes of EnergySourceHelper only have to implement this function, to create and aggregate an ...
Ptr< energy::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.
Holds a vector of ns3::EnergySource pointers.
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.