diff options
| author | Loic Guegan <manzerberdes@gmx.com> | 2019-04-12 13:52:06 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerberdes@gmx.com> | 2019-04-12 13:52:06 +0200 |
| commit | 927283437161307a23a954b42297412ba03a619c (patch) | |
| tree | 38c0abc5ae8df4edd428b3662d733882d76ebdf3 /ns3-simulator/main.cc | |
| parent | 23e8f7f688da3df8d5b4d47e881865717141325c (diff) | |
Init final simulator source
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); +} |
