Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(102)

Unified Diff: src/energy/model/energy-source.h

Issue 103750047: Added the concept of energy harvester to the existing ns-3 energy framework
Patch Set: Implemented the reviewers comments to Patch Set 2 Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/energy/model/energy-harvester.cc ('k') | src/energy/model/energy-source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/energy/model/energy-source.h
===================================================================
--- a/src/energy/model/energy-source.h
+++ b/src/energy/model/energy-source.h
@@ -16,8 +16,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors: Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
+ *
+ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
+ * University of Rochester, Rochester, NY, USA.
+ *
+ * Modifications made by: Cristiano Tapparello <cristiano.tapparello@rochester.edu>
*/
+
#ifndef ENERGY_SOURCE_H
#define ENERGY_SOURCE_H
@@ -26,9 +32,10 @@
#include "ns3/type-id.h"
#include "ns3/node.h"
#include "device-energy-model-container.h" // #include "device-energy-model.h"
+#include "ns3/energy-harvester.h"
namespace ns3 {
-
+
/**
* \defgroup energy Energy Models
*
@@ -68,6 +75,9 @@
* energy in different units (eg. kWh), a simple converter function should
* suffice.
*/
+
+class EnergyHarvester;
+
class EnergySource : public Object
{
public:
@@ -158,6 +168,17 @@
* here. Called by EnergySourceContainer, which is aggregated to the node.
*/
void DisposeDeviceModels (void);
+
+ /**
+ * \param energyHarvesterPtr Pointer to energy harvester.
+ *
+ * This function connect an energy harvester to the energy source. After the
+ * execution of this method, the pointer to the energy harvester is appended
+ * to the end of a vector of EnergyHarvester pointer.
+ * Note that the order in which different energy harvester are added to the
+ * energy source does not impact the simulation results.
+ */
+ void ConnectEnergyHarvester (Ptr<EnergyHarvester> energyHarvesterPtr);
private:
@@ -180,6 +201,13 @@
* sure device models are installed onto the corresponding node.
*/
Ptr<Node> m_node;
+
+ /**
+ * Vector of EnergyHarvester pointer connected to the same energy source.
+ * This vector is used by the CalculateTotalCurrent method to determine the
+ * total power provided by the energy harvesters connected to the energy source.
+ */
+ std::vector< Ptr<EnergyHarvester> > m_harvesters;
protected:
« no previous file with comments | « src/energy/model/energy-harvester.cc ('k') | src/energy/model/energy-source.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b