diff options
| author | Loic Guegan <manzerberdes@gmx.com> | 2019-05-22 11:24:17 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerberdes@gmx.com> | 2019-05-22 11:24:17 +0200 |
| commit | 8bdcd37ac44fe96d2c59424a24752f87f0444e36 (patch) | |
| tree | e31a0fe38c01bc6814a0b35474875fe538ea87c2 /src/ns3/nix/simulator/modules/callbacks.cc | |
| parent | 5a77b67d6baae0414310d29cab6f240963866062 (diff) | |
Update paper
Diffstat (limited to 'src/ns3/nix/simulator/modules/callbacks.cc')
| -rw-r--r-- | src/ns3/nix/simulator/modules/callbacks.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ns3/nix/simulator/modules/callbacks.cc b/src/ns3/nix/simulator/modules/callbacks.cc new file mode 100644 index 0000000..4ae0c97 --- /dev/null +++ b/src/ns3/nix/simulator/modules/callbacks.cc @@ -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"); +} |
