LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), | 3 * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), |
4 * University of Rochester, Rochester, NY, USA. | 4 * University of Rochester, Rochester, NY, USA. |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 27 matching lines...) Expand all Loading... |
38 * \ingroup energy | 38 * \ingroup energy |
39 * BasicEnergyHarvester increases remaining energy stored in an associated | 39 * BasicEnergyHarvester increases remaining energy stored in an associated |
40 * Energy Source. The BasicEnergyHarvester implements a simple model in which | 40 * Energy Source. The BasicEnergyHarvester implements a simple model in which |
41 * the amount of power provided by the harvester varies over time according | 41 * the amount of power provided by the harvester varies over time according |
42 * to a customizable generic random variable and time update intervals. | 42 * to a customizable generic random variable and time update intervals. |
43 * | 43 * |
44 * Unit of power is chosen as Watt since energy models typically calculate | 44 * Unit of power is chosen as Watt since energy models typically calculate |
45 * energy as (time in seconds * power in Watt). | 45 * energy as (time in seconds * power in Watt). |
46 * | 46 * |
47 */ | 47 */ |
48 class BasicEnergyHarvester: public EnergyHarvester | 48 class BasicEnergyHarvester : public EnergyHarvester |
49 { | 49 { |
50 public: | 50 public: |
51 /** | 51 /** |
52 * \brief Get the type ID. | 52 * \brief Get the type ID. |
53 * \return the object TypeId | 53 * \return the object TypeId |
54 */ | 54 */ |
55 static TypeId GetTypeId (void); | 55 static TypeId GetTypeId (void); |
56 | 56 |
57 BasicEnergyHarvester (); | 57 BasicEnergyHarvester (); |
58 | 58 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 virtual double DoGetPower (void) const; | 111 virtual double DoGetPower (void) const; |
112 | 112 |
113 /** | 113 /** |
114 * This function is called every m_energyHarvestingUpdateInterval in order to | 114 * This function is called every m_energyHarvestingUpdateInterval in order to |
115 * update the amount of power that will be provided by the harvester in the | 115 * update the amount of power that will be provided by the harvester in the |
116 * next interval. | 116 * next interval. |
117 */ | 117 */ |
118 void UpdateHarvestedPower (void); | 118 void UpdateHarvestedPower (void); |
119 | 119 |
120 private: | 120 private: |
121 | |
122 Ptr<RandomVariableStream> m_harvestablePower; ///< Random variable for the har
vestable power | 121 Ptr<RandomVariableStream> m_harvestablePower; ///< Random variable for the har
vestable power |
123 | 122 |
124 TracedValue<double> m_harvestedPower; ///< current harvested power, in
Watt | 123 TracedValue<double> m_harvestedPower; ///< current harvested power, in
Watt |
125 TracedValue<double> m_totalEnergyHarvestedJ; ///< total harvested energy, in
Joule | 124 TracedValue<double> m_totalEnergyHarvestedJ; ///< total harvested energy, in
Joule |
126 | 125 |
127 EventId m_energyHarvestingUpdateEvent; ///< energy harvesting event | 126 EventId m_energyHarvestingUpdateEvent; ///< energy harvesting event |
128 Time m_lastHarvestingUpdateTime; ///< last harvesting time | 127 Time m_lastHarvestingUpdateTime; ///< last harvesting time |
129 Time m_harvestedPowerUpdateInterval; ///< harvestable energy update i
nterval | 128 Time m_harvestedPowerUpdateInterval; ///< harvestable energy update i
nterval |
130 | 129 |
131 }; | 130 }; |
132 | 131 |
133 } // namespace ns3 | 132 } // namespace ns3 |
134 | 133 |
135 #endif /* defined(BASIC_ENERGY_HARVESTER) */ | 134 #endif /* defined(BASIC_ENERGY_HARVESTER) */ |
LEFT | RIGHT |