|
193 |
packet->PeekHeader (head); |
193 |
packet->PeekHeader (head); |
194 |
Mac48Address dest = head.GetAddr1 (); |
194 |
Mac48Address dest = head.GetAddr1 (); |
195 |
|
195 |
|
196 |
totalEnergy += actualPower[dest] * GetCalcTxTime (actualMode[dest]).GetSeconds (); |
196 |
if (head.GetType() == WIFI_MAC_DATA) |
197 |
totalTime += GetCalcTxTime (actualMode[dest]).GetSeconds (); |
197 |
{ |
198 |
|
198 |
totalEnergy += pow(10, actualPower[dest] / 10) * GetCalcTxTime (actualMode[dest]).GetSeconds (); |
|
|
199 |
totalTime += GetCalcTxTime (actualMode[dest]).GetSeconds (); |
200 |
} |
199 |
} |
201 |
} |
200 |
|
202 |
|
201 |
void |
203 |
void |
|
259 |
{ |
261 |
{ |
260 |
double mbs = ((m_bytesTotal * 8.0) / (1000000 * time)); |
262 |
double mbs = ((m_bytesTotal * 8.0) / (1000000 * time)); |
261 |
m_bytesTotal = 0; |
263 |
m_bytesTotal = 0; |
262 |
double atm = pow (10, ((totalEnergy / time) / 10)); |
264 |
double atp = totalEnergy / time; |
263 |
totalEnergy = 0; |
265 |
totalEnergy = 0; |
264 |
totalTime = 0; |
266 |
totalTime = 0; |
265 |
m_output_power.Add ((Simulator::Now ()).GetSeconds (), atm); |
267 |
m_output_power.Add ((Simulator::Now ()).GetSeconds (), atp); |
266 |
m_output.Add ((Simulator::Now ()).GetSeconds (), mbs); |
268 |
m_output.Add ((Simulator::Now ()).GetSeconds (), mbs); |
267 |
|
269 |
|
268 |
m_output_idle.Add ((Simulator::Now ()).GetSeconds (), idleTime * 100); |
270 |
m_output_idle.Add ((Simulator::Now ()).GetSeconds (), idleTime * 100); |