View | Details | Raw Unified | Return to bug 2154
Collapse All | Expand All

(-)a/examples/wireless/power-adaptation-distance.cc (-5 / +7 lines)
 Lines 197-205    Link Here 
197
  packet->PeekHeader (head);
197
  packet->PeekHeader (head);
198
  Mac48Address dest = head.GetAddr1 ();
198
  Mac48Address dest = head.GetAddr1 ();
199
199
200
  totalEnergy += actualPower[dest] * GetCalcTxTime (actualMode[dest]).GetSeconds ();
200
  if (head.GetType() == WIFI_MAC_DATA)
201
  totalTime += GetCalcTxTime (actualMode[dest]).GetSeconds ();
201
    {
202
202
      totalEnergy += pow (10, actualPower[dest] / 10) * GetCalcTxTime (actualMode[dest]).GetSeconds ();
203
      totalTime += GetCalcTxTime (actualMode[dest]).GetSeconds ();
204
    }
203
}
205
}
204
206
205
void
207
void
 Lines 259-268    Link Here 
259
  Vector pos = GetPosition (node);
261
  Vector pos = GetPosition (node);
260
  double mbs = ((m_bytesTotal * 8.0) / (1000000 * stepsTime));
262
  double mbs = ((m_bytesTotal * 8.0) / (1000000 * stepsTime));
261
  m_bytesTotal = 0;
263
  m_bytesTotal = 0;
262
  double atm = pow (10, ((totalEnergy / stepsTime) / 10));
264
  double atp = totalEnergy / stepsTime;
263
  totalEnergy = 0;
265
  totalEnergy = 0;
264
  totalTime = 0;
266
  totalTime = 0;
265
  m_output_power.Add (pos.x, atm);
267
  m_output_power.Add (pos.x, atp);
266
  m_output.Add (pos.x, mbs);
268
  m_output.Add (pos.x, mbs);
267
  pos.x += stepsSize;
269
  pos.x += stepsSize;
268
  SetPosition (node, pos);
270
  SetPosition (node, pos);
(-)a/examples/wireless/power-adaptation-interference.cc (-5 / +7 lines)
 Lines 193-201    Link Here 
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
 Lines 259-268    Link Here 
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);

Return to bug 2154