Start some simulation tests

This commit is contained in:
Loic Guegan 2019-04-25 15:51:05 +02:00
parent 1399886f4d
commit a6e70544bb
37 changed files with 53416 additions and 5509 deletions

View file

@ -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");
}

View file

@ -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