mirror of
https://gitlab.com/manzerbredes/paper-lowrate-iot.git
synced 2025-05-01 09:27:45 +00:00
Debug+Do Simulations
This commit is contained in:
parent
79ef212a8c
commit
89d815f81e
70 changed files with 190288 additions and 312708 deletions
12
ns3-simulations/simulator/modules/callbacks.cc
Normal file
12
ns3-simulations/simulator/modules/callbacks.cc
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
#include "modules.hpp"
|
||||
|
||||
void PktReceived(std::string nodeName,Ptr< const Packet > packet, const Address &address){
|
||||
NS_LOG_UNCOND("Node " << nodeName << " receive a packet" << " at time " << Simulator::Now ().GetSeconds () << "s");
|
||||
}
|
||||
|
||||
void EnergyUpdated(std::string nodeName,double oldValue, double newValue){
|
||||
double currentTime=Simulator::Now ().GetSeconds ();
|
||||
double energyConsumes=newValue-oldValue;
|
||||
NS_LOG_UNCOND("Node " << nodeName << " consumes " << energyConsumes << "J" << " at time " << currentTime << "s");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue