diff options
Diffstat (limited to 'ns3-simulations/ns3-simulator/modules')
| -rw-r--r-- | ns3-simulations/ns3-simulator/modules/callbacks.cc | 8 | ||||
| -rw-r--r-- | ns3-simulations/ns3-simulator/modules/modules.hpp | 5 |
2 files changed, 10 insertions, 3 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"); + } diff --git a/ns3-simulations/ns3-simulator/modules/modules.hpp b/ns3-simulations/ns3-simulator/modules/modules.hpp index c47dc39..321926d 100644 --- a/ns3-simulations/ns3-simulator/modules/modules.hpp +++ b/ns3-simulations/ns3-simulator/modules/modules.hpp @@ -26,6 +26,7 @@ #include "ns3/point-to-point-helper.h" #include "ns3/ecofen-module.h" #include "ns3/node-list.h" +#include "ns3/flow-monitor-module.h" // C++ library #include <iostream> // Why not ? @@ -33,11 +34,11 @@ #include <iomanip> // To use std::setw // ECOFEN -#define ECOFEN_LOG_UNTIL 1 +#define ECOFEN_LOG_UNTIL 100 #define ECOFEN_LOG_EVERY 0.1 // WIFI Energy Values -#define BASICENERGYSOURCEINITIALENERGYJ 1000 +#define BASICENERGYSOURCEINITIALENERGYJ 2.9009 #define BASICENERGYSUPPLYVOLTAGEV 3.3 #define TXCURRENTA 0.38 #define RXCURRENTA 0.313 |
