mirror of
https://gitlab.com/manzerbredes/paper-lowrate-iot.git
synced 2025-06-07 23:27:39 +00:00
13 lines
534 B
Text
13 lines
534 B
Text
![]() |
|
||
|
#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 ();
|
||
|
:q! double energyConsumes=newValue-oldValue;
|
||
|
NS_LOG_UNCOND("Node " << nodeName << " consumes " << energyConsumes << "J" << " at time " << currentTime << "s");
|
||
|
}
|