summaryrefslogtreecommitdiff
path: root/ns3-simulator/main.cc
diff options
context:
space:
mode:
authorLoic Guegan <manzerberdes@gmx.com>2019-04-24 16:49:40 +0200
committerLoic Guegan <manzerberdes@gmx.com>2019-04-24 16:49:40 +0200
commit1da73fb60964a92442d66454265897259120582a (patch)
tree3e64e0083ba73ad6c5b2aceca42ce5de726a197e /ns3-simulator/main.cc
parent39507e0bb50cc77a377a506f8aee73d7ee306b0e (diff)
Add simulation scripts
Diffstat (limited to 'ns3-simulator/main.cc')
-rw-r--r--ns3-simulator/main.cc46
1 files changed, 0 insertions, 46 deletions
diff --git a/ns3-simulator/main.cc b/ns3-simulator/main.cc
deleted file mode 100644
index 0e4e0f9..0000000
--- a/ns3-simulator/main.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "modules/modules.hpp"
-
-NS_LOG_COMPONENT_DEFINE ("WIFISensorsSimulator");
-
-
-/**
- * To get more details about functions please have a look at modules/modules.hpp
- */
-int main(int argc, char* argv[]){
-
- uint32_t sensorsFrequency=1;
- uint32_t sensorsPktSize=150;
- uint32_t sensorsNumber=2;
- uint32_t nbHop=5;
- uint32_t linksBandwidth=5;
- uint32_t linksLatency=2;
-
- CommandLine cmd;
- cmd.AddValue ("sensorsSendInterval", "Number of sensors measurement per second", sensorsFrequency);
- cmd.AddValue ("sensorsPktSize", "Sensors packet size (bytes)", sensorsPktSize);
- cmd.AddValue ("sensorsNumber", "Number of sensors connected to AP", sensorsNumber);
- cmd.AddValue ("nbHop", "Number of hop between AP and Cloud", sensorsNumber);
- cmd.AddValue ("linksBandwidth", "Links bandwidth between AP and Cloud", linksBandwidth);
- cmd.AddValue ("linksLatency", "Links latency between AP and Cloud", linksLatency);
- cmd.Parse (argc, argv);
-
- //LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
- //LogComponentEnable("PacketSink", LOG_LEVEL_INFO);
-
- // ---------- Setup Simulations ----------
- CloudInfos cloud=createCloud(nbHop,linksBandwidth,linksLatency); // Create cloud P2P node chain o--o--o--o--o
- setupCloudEnergy(cloud); // DO IT JUST AFTER createCloud !!!!! Otherwise you will be in trouble
- Cell cell=createCell(sensorsNumber,cloud.first.Get(0)); // Use first cloud node as Access Point
- setupScenario(cell,cloud,sensorsPktSize,sensorsFrequency); // Send data from Sensors to Cloud
- setupCellEnergy(cell);
-
- // Don't forget the following
- Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-
- // Run Simulations
- Simulator::Stop (Seconds (20));
- Simulator::Run ();
- Simulator::Destroy ();
-
- return(0);
-}