examples/energy/energy-model-example.cc
changeset 7252 c8200621e252
parent 7231 619d57dab032
child 7704 aef733235832
equal deleted inserted replaced
7251:b2fe610ad03f 7252:c8200621e252
    88 /// Trace function for remaining energy at node.
    88 /// Trace function for remaining energy at node.
    89 void
    89 void
    90 RemainingEnergy (double oldValue, double remainingEnergy)
    90 RemainingEnergy (double oldValue, double remainingEnergy)
    91 {
    91 {
    92   NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
    92   NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
    93       << "s Current remaining energy = " << remainingEnergy << "J");
    93                  << "s Current remaining energy = " << remainingEnergy << "J");
    94 }
    94 }
    95 
    95 
    96 /// Trace function for total energy consumption at node.
    96 /// Trace function for total energy consumption at node.
    97 void
    97 void
    98 TotalEnergy (double oldValue, double totalEnergy)
    98 TotalEnergy (double oldValue, double totalEnergy)
    99 {
    99 {
   100   NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
   100   NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
   101       << "s Total energy consumed by radio = " << totalEnergy << "J");
   101                  << "s Total energy consumed by radio = " << totalEnergy << "J");
   102 }
   102 }
   103 
   103 
   104 int
   104 int
   105 main (int argc, char *argv[])
   105 main (int argc, char *argv[])
   106 {
   106 {