OLD | NEW |
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) 2010 Andrea Sacco | 3 * Copyright (c) 2010 Andrea Sacco |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 20 matching lines...) Expand all Loading... |
31 * \ingroup energy | 31 * \ingroup energy |
32 * | 32 * |
33 * A simple device energy model where current drain can be set by the user. | 33 * A simple device energy model where current drain can be set by the user. |
34 * | 34 * |
35 * It is supposed to be used as a testing model for energy sources. | 35 * It is supposed to be used as a testing model for energy sources. |
36 * | 36 * |
37 */ | 37 */ |
38 class SimpleDeviceEnergyModel : public DeviceEnergyModel | 38 class SimpleDeviceEnergyModel : public DeviceEnergyModel |
39 { | 39 { |
40 public: | 40 public: |
| 41 /** |
| 42 * \brief Get the type ID. |
| 43 * \return the object TypeId |
| 44 */ |
41 static TypeId GetTypeId (void); | 45 static TypeId GetTypeId (void); |
42 SimpleDeviceEnergyModel (); | 46 SimpleDeviceEnergyModel (); |
43 virtual ~SimpleDeviceEnergyModel (); | 47 virtual ~SimpleDeviceEnergyModel (); |
44 | 48 |
45 /** | 49 /** |
46 * \brief Sets pointer to node. | 50 * \brief Sets pointer to node. |
47 * | 51 * |
48 * \param node Pointer to node. | 52 * \param node Pointer to node. |
49 * | 53 * |
50 * Implements DeviceEnergyModel::SetNode. | 54 * Implements DeviceEnergyModel::SetNode. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 private: | 116 private: |
113 void DoDispose (void); | 117 void DoDispose (void); |
114 | 118 |
115 /** | 119 /** |
116 * \returns Current draw of device, at current state. | 120 * \returns Current draw of device, at current state. |
117 * | 121 * |
118 * Implements DeviceEnergyModel::GetCurrentA. | 122 * Implements DeviceEnergyModel::GetCurrentA. |
119 */ | 123 */ |
120 virtual double DoGetCurrentA (void) const; | 124 virtual double DoGetCurrentA (void) const; |
121 | 125 |
122 Time m_lastUpdateTime; | 126 Time m_lastUpdateTime; ///< last update time |
123 double m_actualCurrentA; | 127 double m_actualCurrentA; ///< actual current |
124 Ptr<EnergySource> m_source; | 128 Ptr<EnergySource> m_source; ///< energy source |
125 Ptr<Node> m_node; | 129 Ptr<Node> m_node; ///< the node |
126 TracedValue<double> m_totalEnergyConsumption; | 130 TracedValue<double> m_totalEnergyConsumption; ///< total energy consumption |
127 }; | 131 }; |
128 | 132 |
129 } // namespace ns3 | 133 } // namespace ns3 |
130 | 134 |
131 #endif /* SIMPLE_DEVICE_ENERGY_MODEL_H */ | 135 #endif /* SIMPLE_DEVICE_ENERGY_MODEL_H */ |
OLD | NEW |