mirror of
https://gitlab.com/manzerbredes/paper-lowrate-iot.git
synced 2025-05-01 09:27:45 +00:00
Init final simulator source
This commit is contained in:
parent
23e8f7f688
commit
9272834371
7 changed files with 302 additions and 0 deletions
41
ns3-simulator/main.cc
Normal file
41
ns3-simulator/main.cc
Normal file
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue