9#include "ns3/boolean.h"
10#include "ns3/command-line.h"
11#include "ns3/config.h"
12#include "ns3/constant-position-mobility-model.h"
13#include "ns3/double.h"
14#include "ns3/gnuplot.h"
15#include "ns3/jakes-propagation-loss-model.h"
16#include "ns3/pointer.h"
17#include "ns3/propagation-loss-model.h"
18#include "ns3/simulator.h"
19#include "ns3/string.h"
39 number = floor(number + 0.5);
43 number =
ceil(number - 0.5);
66 plot.AppendExtra(
"set ylabel 'rxPower (dBm)'");
67 plot.AppendExtra(
"set key top right");
76 a->SetPosition(Vector(0.0, 0.0, 0.0));
78 for (
double distance = 0.0; distance <
targetDistance; distance += step)
80 b->SetPosition(Vector(distance, 0.0, 0.0));
92 std::ostringstream os;
124 plot.AppendExtra(
"set ylabel 'rxPower (dBm)'");
125 plot.AppendExtra(
"set zlabel 'Probability' offset 0,+10");
126 plot.AppendExtra(
"set view 50, 120, 1.0, 1.0");
127 plot.AppendExtra(
"set key top right");
129 plot.AppendExtra(
"set ticslevel 0");
130 plot.AppendExtra(
"set xtics offset -0.5,0");
131 plot.AppendExtra(
"set ytics offset 0,-0.5");
132 plot.AppendExtra(
"set xrange [100:]");
139 dataset.SetExtra(
"pointtype 3 pointsize 0.5");
146 a->SetPosition(Vector(0.0, 0.0, 0.0));
148 for (
double distance = 100.0; distance <
targetDistance; distance += step)
150 b->SetPosition(Vector(distance, 0.0, 0.0));
174 std::ostringstream os;
204 plot.AppendExtra(
"set ylabel 'rxPower (dBm)'");
205 plot.AppendExtra(
"set key center right");
214 a->SetPosition(Vector(0.0, 0.0, 0.0));
215 b->SetPosition(Vector(distance, 0.0, 0.0));
231 std::ostringstream os;
247 cmd.AddValue(
"test",
"Run as a test, sample the models only once",
test);
271 plot.SetTitle(
"ns3::FriisPropagationLossModel (Default Parameters)");
280 plot.SetTitle(
"ns3::LogDistancePropagationLossModel (Exponent = 2.5)");
291 plot.SetTitle(
"ns3::RandomPropagationLossModel with Exponential Distribution");
303 "ns3::JakesPropagationLossModel (with 477.9 Hz shift and 1 millisec resolution)");
320 "ns3::JakesPropagationLossModel (with 477.9 Hz shift and 0.1 millisec resolution)");
333 plot.SetTitle(
"ns3::ThreeLogDistancePropagationLossModel (Defaults)");
346 plot.SetTitle(
"ns3::ThreeLogDistancePropagationLossModel (Exponents 1.0, 3.0 and 10.0)");
355 plot.SetTitle(
"ns3::NakagamiPropagationLossModel (Default Parameters)");
368 plot.SetTitle(
"ns3::ThreeLogDistancePropagationLossModel and "
369 "ns3::NakagamiPropagationLossModel (Default Parameters)");
Parse command-line arguments.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Class to represent a 2D points plot.
void SetStyle(Style style)
Class to represent a 2D function expression plot.
Class to represent a 3D points plot.
void SetStyle(const std::string &style)
a simple class to group together multiple gnuplots into one file, e.g.
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
void AppendExtra(const std::string &extra)
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Simulation virtual time values and global simulation resolution.
void SetDefault(std::string name, const AttributeValue &value)
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
static double dround(double number, double precision)
Round a double number to the given precision.
static Gnuplot TestDeterministicByTime(Ptr< PropagationLossModel > model, Time timeStep, Time timeTotal, double distance)
Test the model by sampling over time.
static Gnuplot TestDeterministic(Ptr< PropagationLossModel > model, double targetDistance, double step)
Test the model by sampling over a distance.
static Gnuplot TestProbabilistic(Ptr< PropagationLossModel > model, double targetDistance, double step, unsigned int samples)
Test the model by sampling over a distance.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
-ns3 Test suite for the ns3 wrapper script