Úlohy:
Originálne i vyriesene súbory : test2019
Vypracovanie:
1 2 3 4 5 6 7 8 9 10 11 12 |
22a23 > #include "ns3/netanim-module.h" 29a29 > bool anim = false; 115a143,149 > if(anim){ > AnimationInterface anim("st15b.xml"); > anim.EnablePacketMetadata(); > anim.UpdateNodeDescription(staWifiNode,"Zdroj"); > anim.UpdateNodeDescription(apWifiNode,"Ciel"); > } > |
UpdateNodeSize, UpdateNodeColor, SetBackgroundImage, SetConstantPosition …
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
23a23 > #include "ns3/command-line.h" 29a33,38 > double vyskyAnten = 0; > CommandLine cmd; > cmd.AddValue("height","Vyska instalovanych anten nad zemou [m]",vyskyAnten); > cmd.Parse(argc,argv); > 44c53,55 < wifiChannel.AddPropagationLoss ("ns3::TwoRayGroundPropagationLossModel"); --- > wifiChannel.AddPropagationLoss ("ns3::TwoRayGroundPropagationLossModel" > ,"HeightAboveZ",DoubleValue(vyskyAnten) > ); |
Config::Set(„/ChannelList/*/$ns3::YansWifiChannel/PropagationLossModel/$ns3::TwoRayGroundPropagationLossModel/HeightAboveZ“,DoubleValue(vyskyAnten));
Config::Set(„/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Channel/$ns3::YansWifiChannel/PropagationLossModel/$ns3::TwoRayGroundPropagationLossModel/HeightAboveZ“, DoubleValue(vyskyAnten));
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
24a25,26 > #include "ns3/gnuplot.h" > #include <sstream> 29a34,54 > double odHodn=0, doHodn=200, krok=10; > cmd.AddValue("height","Vyska instalovanych anten nad zemou [m]",vyskyAnten); > cmd.AddValue("od","Pociatocna vzdialenost anten [m]",distOd); > cmd.AddValue("do","Konecna vzdialenost anten [m]",distDo); > cmd.AddValue("krok","Krok zmeny vzdialenosti [m]",krok); > cmd.Parse(argc,argv); > > Gnuplot graf("st13a.svg"); > graf.SetTerminal("svg"); > graf.SetTitle("streda 13:00 skupina-A"); > graf.SetLegend("Vzdialenost anten (m)","Priepustnost (Mbit/s)"); > Gnuplot2dDataset data; > std::ostringstream str; str << "Vyska anten " << vyskyAnten << " m."; > data.SetTitle (str.str() ); > data.SetStyle (Gnuplot2dDataset::LINES_POINTS); > 36a62 > for (double x = odHodn; x <= doHodn; x +=krok){ 78c107 < positionAlloc->Add (Vector (1.0, 1.0, 0.0)); --- > positionAlloc->Add (Vector (x, 0.0, 0.0)); 121a155,156 < std::cout << averageThroughput; --- > //std::cout << averageThroughput; > data.Add(x,averageThroughput); 124a159,164 > } > graf.AddDataset (data); > std::ofstream plotFile ("graf.plt"); > graf.GenerateOutput (plotFile); > plotFile.close (); > if(system("gnuplot graf.plt")); |