diff options
Diffstat (limited to 'ns3-simulator/main.cc')
| -rw-r--r-- | ns3-simulator/main.cc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ns3-simulator/main.cc b/ns3-simulator/main.cc new file mode 100644 index 0000000..0c5c405 --- /dev/null +++ b/ns3-simulator/main.cc @@ -0,0 +1,41 @@ +#include "modules/modules.hpp" + +NS_LOG_COMPONENT_DEFINE ("WIFISensorsSimulator"); + + +int main(int argc, char* argv[]){ + + uint32_t sensorsFrequency=1; + uint32_t sensorsPktSize=150; + uint32_t sensorsNumber=2; + uint32_t nbHop=5; + + CommandLine cmd; + cmd.AddValue ("sensorsSendInterval", "Number of temperature measurement per second", sensorsFrequency); + cmd.AddValue ("sensorsPktSize", "Sensor measurements packet size (bytes)", sensorsPktSize); + cmd.AddValue ("sensorsNumber", "Number of sensors", sensorsNumber); + cmd.AddValue ("nbHop", "Number of hop between AP and Cloud sensors", sensorsNumber); + cmd.Parse (argc, argv); + + //LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); + //LogComponentEnable("PacketSink", LOG_LEVEL_INFO); + + // Setup Simulations + CloudInfos cloud=buildEdgeAndCloud(nbHop); + Cell c=createCell(sensorsNumber,cloud.first.Get(0)); + applyScenarios(c,sensorsPktSize,sensorsFrequency,cloud); // Send data from Sensors to Cloud + // setupEnergy(c); + Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + + + + + // Run simulators + Simulator::Stop (Seconds (20)); + Simulator::Run (); + Simulator::Destroy (); // Destroy + + + + return(0); +} |
