summaryrefslogtreecommitdiff
path: root/ns3-simulations/ns3-simulator/modules/callbacks.cc
diff options
context:
space:
mode:
authorLoic Guegan <manzerberdes@gmx.com>2019-04-25 15:51:05 +0200
committerLoic Guegan <manzerberdes@gmx.com>2019-04-25 15:51:05 +0200
commita6e70544bb28c209891ea5335be0d2939f0737d6 (patch)
tree361f3989128bff0633fd956b00f10ce7ee629003 /ns3-simulations/ns3-simulator/modules/callbacks.cc
parent1399886f4d56370d713ba3262b83df1df008d2a7 (diff)
Start some simulation tests
Diffstat (limited to 'ns3-simulations/ns3-simulator/modules/callbacks.cc')
-rw-r--r--ns3-simulations/ns3-simulator/modules/callbacks.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ns3-simulations/ns3-simulator/modules/callbacks.cc b/ns3-simulations/ns3-simulator/modules/callbacks.cc
index ca04730..8e9e00f 100644
--- a/ns3-simulations/ns3-simulator/modules/callbacks.cc
+++ b/ns3-simulations/ns3-simulator/modules/callbacks.cc
@@ -6,5 +6,11 @@ void PktReceived(std::string nodeName,Ptr< const Packet > packet, const Address
}
void EnergyUpdated(std::string nodeName,double oldValue, double newValue){
- NS_LOG_UNCOND("Node " << nodeName << " consumes " << newValue-oldValue << "J" << " at time " << Simulator::Now ().GetSeconds () << "s");
+ double currentTime=Simulator::Now ().GetSeconds ();
+ double energyConsumes=newValue-oldValue;
+ NS_LOG_UNCOND("Node " << nodeName << " consumes " << energyConsumes << "J" << " at time " << currentTime << "s");
+
+ NS_LOG_UNCOND("Node " << nodeName << " newVal " << newValue << "J" << " at time " << currentTime << "s");
+ NS_LOG_UNCOND("Node " << nodeName << " oldValue " << oldValue << "J" << " at time " << currentTime << "s");
+
}