A Discrete-Event Network Simulator
API
main-random-variable-stream.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 Timo Bingmann
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Timo Bingmann <timo.bingmann@student.kit.edu>
18 */
19#include "ns3/command-line.h"
20#include "ns3/double.h"
21#include "ns3/gnuplot.h"
22#include "ns3/integer.h"
23#include "ns3/ptr.h"
24#include "ns3/random-variable-stream.h"
25#include "ns3/string.h"
26
27#include <cmath>
28#include <map>
29
37using namespace ns3;
38
39namespace
40{
41
50double
51dround(double number, double precision)
52{
53 number /= precision;
54 if (number >= 0)
55 {
56 number = std::floor(number + 0.5);
57 }
58 else
59 {
60 number = std::ceil(number - 0.5);
61 }
62 number *= precision;
63 return number;
64}
65
77 unsigned int probes,
78 double precision,
79 const std::string& title,
80 bool impulses = false)
81{
82 typedef std::map<double, unsigned int> histogram_maptype;
83 histogram_maptype histogram;
84
85 for (unsigned int i = 0; i < probes; ++i)
86 {
87 double val = dround(rndvar->GetValue(), precision);
88
89 ++histogram[val];
90 }
91
93 data.SetTitle(title);
94
95 if (impulses)
96 {
97 data.SetStyle(Gnuplot2dDataset::IMPULSES);
98 }
99
100 for (histogram_maptype::const_iterator hi = histogram.begin(); hi != histogram.end(); ++hi)
101 {
102 data.Add(hi->first, (double)hi->second / (double)probes / precision);
103 }
104
105 return data;
106}
107
108} // unnamed namespace
109
110int
111main(int argc, char* argv[])
112{
113 CommandLine cmd(__FILE__);
114 cmd.Parse(argc, argv);
115
116 unsigned int probes = 1000000;
117 double precision = 0.01;
118
119 GnuplotCollection gnuplots("main-random-variables.pdf");
120 gnuplots.SetTerminal("pdf enhanced");
121
122 {
123 Gnuplot plot;
124 plot.SetTitle("UniformRandomVariable");
125 plot.AppendExtra("set yrange [0:]");
126
127 Ptr<UniformRandomVariable> x = CreateObject<UniformRandomVariable>();
128 x->SetAttribute("Min", DoubleValue(0.0));
129 x->SetAttribute("Max", DoubleValue(1.0));
130
131 plot.AddDataset(Histogram(x, probes, precision, "UniformRandomVariable [0.0 .. 1.0)"));
132 plot.AddDataset(Gnuplot2dFunction("1.0", "0 <= x && x <= 1 ? 1.0 : 0"));
133
134 gnuplots.AddPlot(plot);
135 }
136
137 {
138 Gnuplot plot;
139 plot.SetTitle("ExponentialRandomVariable");
140 plot.AppendExtra("set xrange [0:8]");
141 plot.AppendExtra("ExpDist(x,l) = 1/l * exp(-1/l * x)");
142
143 Ptr<ExponentialRandomVariable> x1 = CreateObject<ExponentialRandomVariable>();
144 x1->SetAttribute("Mean", DoubleValue(0.5));
145
146 plot.AddDataset(Histogram(x1, probes, precision, "ExponentialRandomVariable m=0.5"));
147
148 plot.AddDataset(Gnuplot2dFunction("ExponentialDistribution mean 0.5", "ExpDist(x, 0.5)"));
149
150 Ptr<ExponentialRandomVariable> x2 = CreateObject<ExponentialRandomVariable>();
151 x2->SetAttribute("Mean", DoubleValue(1.0));
152
153 plot.AddDataset(Histogram(x2, probes, precision, "ExponentialRandomVariable m=1"));
154
155 plot.AddDataset(Gnuplot2dFunction("ExponentialDistribution mean 1.0", "ExpDist(x, 1.0)"));
156
157 Ptr<ExponentialRandomVariable> x3 = CreateObject<ExponentialRandomVariable>();
158 x3->SetAttribute("Mean", DoubleValue(1.5));
159
160 plot.AddDataset(Histogram(x3, probes, precision, "ExponentialRandomVariable m=1.5"));
161
162 plot.AddDataset(Gnuplot2dFunction("ExponentialDistribution mean 1.5", "ExpDist(x, 1.5)"));
163
164 gnuplots.AddPlot(plot);
165 }
166
167 {
168 Gnuplot plot;
169 plot.SetTitle("ParetoRandomVariable");
170 plot.AppendExtra("set xrange [0:2]");
171
172 Ptr<ParetoRandomVariable> x1 = CreateObject<ParetoRandomVariable>();
173 x1->SetAttribute("Scale", DoubleValue(1.0));
174 x1->SetAttribute("Shape", DoubleValue(1.5));
175
176 plot.AddDataset(
177 Histogram(x1, probes, precision, "ParetoRandomVariable scale=1.0 shape=1.5"));
178
179 Ptr<ParetoRandomVariable> x2 = CreateObject<ParetoRandomVariable>();
180 x2->SetAttribute("Scale", DoubleValue(1.0));
181 x2->SetAttribute("Shape", DoubleValue(2.0));
182
183 plot.AddDataset(
184 Histogram(x2, probes, precision, "ParetoRandomVariable scale=1.0 shape=2.0"));
185
186 Ptr<ParetoRandomVariable> x3 = CreateObject<ParetoRandomVariable>();
187 x3->SetAttribute("Scale", DoubleValue(1.0));
188 x3->SetAttribute("Shape", DoubleValue(2.5));
189
190 plot.AddDataset(
191 Histogram(x3, probes, precision, "ParetoRandomVariable scale=1.0 shape=2.5"));
192
193 gnuplots.AddPlot(plot);
194 }
195
196 {
197 Gnuplot plot;
198 plot.SetTitle("WeibullRandomVariable");
199 plot.AppendExtra("set xrange [0:3]");
200
201 Ptr<WeibullRandomVariable> x1 = CreateObject<WeibullRandomVariable>();
202 x1->SetAttribute("Scale", DoubleValue(1.0));
203 x1->SetAttribute("Shape", DoubleValue(1.0));
204
205 plot.AddDataset(
206 Histogram(x1, probes, precision, "WeibullRandomVariable scale=1.0 shape=1.0"));
207
208 Ptr<WeibullRandomVariable> x2 = CreateObject<WeibullRandomVariable>();
209 x2->SetAttribute("Scale", DoubleValue(1.0));
210 x2->SetAttribute("Shape", DoubleValue(2.0));
211
212 plot.AddDataset(
213 Histogram(x2, probes, precision, "WeibullRandomVariable scale=1.0 shape=2.0"));
214
215 Ptr<WeibullRandomVariable> x3 = CreateObject<WeibullRandomVariable>();
216 x3->SetAttribute("Scale", DoubleValue(1.0));
217 x3->SetAttribute("Shape", DoubleValue(3.0));
218
219 plot.AddDataset(
220 Histogram(x3, probes, precision, "WeibullRandomVariable scale=1.0 shape=3.0"));
221
222 gnuplots.AddPlot(plot);
223 }
224
225 {
226 Gnuplot plot;
227 plot.SetTitle("NormalRandomVariable");
228 plot.AppendExtra("set xrange [-3:3]");
229 plot.AppendExtra(
230 "NormalDist(x,m,s) = 1 / (s * sqrt(2*pi)) * exp(-1.0 / 2.0 * ((x-m) / s)**2)");
231
232 Ptr<NormalRandomVariable> x1 = CreateObject<NormalRandomVariable>();
233 x1->SetAttribute("Mean", DoubleValue(0.0));
234 x1->SetAttribute("Variance", DoubleValue(1.0));
235
236 plot.AddDataset(Histogram(x1, probes, precision, "NormalRandomVariable m=0.0 v=1.0"));
237
238 plot.AddDataset(Gnuplot2dFunction("NormalDist {/Symbol m}=0.0 {/Symbol s}=1.0",
239 "NormalDist(x,0.0,1.0)"));
240
241 Ptr<NormalRandomVariable> x2 = CreateObject<NormalRandomVariable>();
242 x2->SetAttribute("Mean", DoubleValue(0.0));
243 x2->SetAttribute("Variance", DoubleValue(2.0));
244
245 plot.AddDataset(Histogram(x2, probes, precision, "NormalRandomVariable m=0.0 v=2.0"));
246
247 plot.AddDataset(Gnuplot2dFunction("NormalDist {/Symbol m}=0.0 {/Symbol s}=sqrt(2.0)",
248 "NormalDist(x,0.0,sqrt(2.0))"));
249
250 Ptr<NormalRandomVariable> x3 = CreateObject<NormalRandomVariable>();
251 x3->SetAttribute("Mean", DoubleValue(0.0));
252 x3->SetAttribute("Variance", DoubleValue(3.0));
253
254 plot.AddDataset(Histogram(x3, probes, precision, "NormalRandomVariable m=0.0 v=3.0"));
255
256 plot.AddDataset(Gnuplot2dFunction("NormalDist {/Symbol m}=0.0 {/Symbol s}=sqrt(3.0)",
257 "NormalDist(x,0.0,sqrt(3.0))"));
258
259 gnuplots.AddPlot(plot);
260 }
261
263 /*
264 {
265 Gnuplot plot;
266 plot.SetTitle ("EmpiricalRandomVariable");
267 plot.AppendExtra ("set xrange [*:*]");
268
269 EmpiricalRandomVariable emp1;
270 emp1.CDF (0.0, 0.0 / 15.0);
271 emp1.CDF (0.2, 1.0 / 15.0);
272 emp1.CDF (0.4, 3.0 / 15.0);
273 emp1.CDF (0.6, 6.0 / 15.0);
274 emp1.CDF (0.8, 10.0 / 15.0);
275 emp1.CDF (1.0, 15.0 / 15.0);
276
277 plot.AddDataset ( Histogram (emp1, probes, precision,
278 "EmpiricalRandomVariable (Stairs)") );
279
280 gnuplots.AddPlot (plot);
281 }
282 */
283
285 /*
286 {
287 Gnuplot plot;
288 plot.SetTitle ("DeterministicRandomVariable");
289 plot.AppendExtra ("set xrange [*:*]");
290
291 double values[] = { 0.0, 0.2, 0.2, 0.4, 0.2, 0.6, 0.8, 0.8, 1.0 };
292 DeterministicRandomVariable det1 (values, sizeof(values) / sizeof(values[0]));
293
294 plot.AddDataset ( Histogram (det1, probes, precision,
295 "DeterministicRandomVariable", true) );
296
297 gnuplots.AddPlot (plot);
298 }
299 */
300
301 {
302 Gnuplot plot;
303 plot.SetTitle("LogNormalRandomVariable");
304 plot.AppendExtra("set xrange [0:3]");
305
306 plot.AppendExtra("LogNormalDist(x,m,s) = 1.0/x * NormalDist(log(x), m, s)");
307
308 Ptr<LogNormalRandomVariable> x1 = CreateObject<LogNormalRandomVariable>();
309 x1->SetAttribute("Mu", DoubleValue(0.0));
310 x1->SetAttribute("Sigma", DoubleValue(1.0));
311
312 plot.AddDataset(Histogram(x1, probes, precision, "LogNormalRandomVariable m=0.0 s=1.0"));
313
314 plot.AddDataset(
315 Gnuplot2dFunction("LogNormalDist(x, 0.0, 1.0)", "LogNormalDist(x, 0.0, 1.0)"));
316
317 Ptr<LogNormalRandomVariable> x2 = CreateObject<LogNormalRandomVariable>();
318 x2->SetAttribute("Mu", DoubleValue(0.0));
319 x2->SetAttribute("Sigma", DoubleValue(0.5));
320
321 plot.AddDataset(Histogram(x2, probes, precision, "LogNormalRandomVariable m=0.0 s=0.5"));
322
323 Ptr<LogNormalRandomVariable> x3 = CreateObject<LogNormalRandomVariable>();
324 x3->SetAttribute("Mu", DoubleValue(0.0));
325 x3->SetAttribute("Sigma", DoubleValue(0.25));
326
327 plot.AddDataset(Histogram(x3, probes, precision, "LogNormalRandomVariable m=0.0 s=0.25"));
328
329 plot.AddDataset(
330 Gnuplot2dFunction("LogNormalDist(x, 0.0, 0.25)", "LogNormalDist(x, 0.0, 0.25)"));
331
332 Ptr<LogNormalRandomVariable> x4 = CreateObject<LogNormalRandomVariable>();
333 x4->SetAttribute("Mu", DoubleValue(0.0));
334 x4->SetAttribute("Sigma", DoubleValue(0.125));
335
336 plot.AddDataset(Histogram(x4, probes, precision, "LogNormalRandomVariable m=0.0 s=0.125"));
337
338 Ptr<LogNormalRandomVariable> x5 = CreateObject<LogNormalRandomVariable>();
339 x5->SetAttribute("Mu", DoubleValue(0.0));
340 x5->SetAttribute("Sigma", DoubleValue(2.0));
341
342 plot.AddDataset(Histogram(x5, probes, precision, "LogNormalRandomVariable m=0.0 s=2.0"));
343
344 plot.AddDataset(
345 Gnuplot2dFunction("LogNormalDist(x, 0.0, 2.0)", "LogNormalDist(x, 0.0, 2.0)"));
346
347 Ptr<LogNormalRandomVariable> x6 = CreateObject<LogNormalRandomVariable>();
348 x6->SetAttribute("Mu", DoubleValue(0.0));
349 x6->SetAttribute("Sigma", DoubleValue(2.5));
350
351 plot.AddDataset(Histogram(x6, probes, precision, "LogNormalRandomVariable m=0.0 s=2.5"));
352
353 gnuplots.AddPlot(plot);
354 }
355
356 {
357 Gnuplot plot;
358 plot.SetTitle("TriangularRandomVariable");
359 plot.AppendExtra("set xrange [*:*]");
360
361 Ptr<TriangularRandomVariable> x1 = CreateObject<TriangularRandomVariable>();
362 x1->SetAttribute("Min", DoubleValue(0.0));
363 x1->SetAttribute("Max", DoubleValue(1.0));
364 x1->SetAttribute("Mean", DoubleValue(0.5));
365
366 plot.AddDataset(
367 Histogram(x1, probes, precision, "TriangularRandomVariable [0.0 .. 1.0) m=0.5"));
368
369 Ptr<TriangularRandomVariable> x2 = CreateObject<TriangularRandomVariable>();
370 x2->SetAttribute("Min", DoubleValue(0.0));
371 x2->SetAttribute("Max", DoubleValue(1.0));
372 x2->SetAttribute("Mean", DoubleValue(0.4));
373
374 plot.AddDataset(
375 Histogram(x2, probes, precision, "TriangularRandomVariable [0.0 .. 1.0) m=0.4"));
376
377 Ptr<TriangularRandomVariable> x3 = CreateObject<TriangularRandomVariable>();
378 x3->SetAttribute("Min", DoubleValue(0.0));
379 x3->SetAttribute("Max", DoubleValue(1.0));
380 x3->SetAttribute("Mean", DoubleValue(0.65));
381
382 plot.AddDataset(
383 Histogram(x3, probes, precision, "TriangularRandomVariable [0.0 .. 1.0) m=0.65"));
384
385 gnuplots.AddPlot(plot);
386 }
387
388 {
389 Gnuplot plot;
390 plot.SetTitle("GammaRandomVariable");
391 plot.AppendExtra("set xrange [0:10]");
392 plot.AppendExtra("set yrange [0:1]");
393 plot.AppendExtra("GammaDist(x,a,b) = x**(a-1) * 1/b**a * exp(-x/b) / gamma(a)");
394
395 plot.AppendExtra(
396 "set label 1 '{/Symbol g}(x,{/Symbol a},{/Symbol b}) = x^{/Symbol a-1} e^{-x {/Symbol "
397 "b}^{-1}} ( {/Symbol b}^{/Symbol a} {/Symbol G}({/Symbol a}) )^{-1}' at 0.7, 0.9");
398
399 Ptr<GammaRandomVariable> x1 = CreateObject<GammaRandomVariable>();
400 x1->SetAttribute("Alpha", DoubleValue(1.0));
401 x1->SetAttribute("Beta", DoubleValue(1.0));
402
403 plot.AddDataset(Histogram(x1, probes, precision, "GammaRandomVariable a=1.0 b=1.0"));
404
405 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 1.0, 1.0)", "GammaDist(x, 1.0, 1.0)"));
406
407 Ptr<GammaRandomVariable> x2 = CreateObject<GammaRandomVariable>();
408 x2->SetAttribute("Alpha", DoubleValue(1.5));
409 x2->SetAttribute("Beta", DoubleValue(1.0));
410
411 plot.AddDataset(Histogram(x2, probes, precision, "GammaRandomVariable a=1.5 b=1.0"));
412
413 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 1.5, 1.0)", "GammaDist(x, 1.5, 1.0)"));
414
415 Ptr<GammaRandomVariable> x3 = CreateObject<GammaRandomVariable>();
416 x3->SetAttribute("Alpha", DoubleValue(2.0));
417 x3->SetAttribute("Beta", DoubleValue(1.0));
418
419 plot.AddDataset(Histogram(x3, probes, precision, "GammaRandomVariable a=2.0 b=1.0"));
420
421 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 2.0, 1.0)", "GammaDist(x, 2.0, 1.0)"));
422
423 Ptr<GammaRandomVariable> x4 = CreateObject<GammaRandomVariable>();
424 x4->SetAttribute("Alpha", DoubleValue(4.0));
425 x4->SetAttribute("Beta", DoubleValue(1.0));
426
427 plot.AddDataset(Histogram(x4, probes, precision, "GammaRandomVariable a=4.0 b=1.0"));
428
429 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 4.0, 1.0)", "GammaDist(x, 4.0, 1.0)"));
430
431 Ptr<GammaRandomVariable> x5 = CreateObject<GammaRandomVariable>();
432 x5->SetAttribute("Alpha", DoubleValue(2.0));
433 x5->SetAttribute("Beta", DoubleValue(2.0));
434
435 plot.AddDataset(Histogram(x5, probes, precision, "GammaRandomVariable a=2.0 b=2.0"));
436
437 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 2.0, 2.0)", "GammaDist(x, 2.0, 2.0)"));
438
439 Ptr<GammaRandomVariable> x6 = CreateObject<GammaRandomVariable>();
440 x6->SetAttribute("Alpha", DoubleValue(2.5));
441 x6->SetAttribute("Beta", DoubleValue(3.0));
442
443 plot.AddDataset(Histogram(x6, probes, precision, "GammaRandomVariable a=2.5 b=3.0"));
444
445 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 2.5, 3.0)", "GammaDist(x, 2.5, 3.0)"));
446
447 Ptr<GammaRandomVariable> x7 = CreateObject<GammaRandomVariable>();
448 x7->SetAttribute("Alpha", DoubleValue(2.5));
449 x7->SetAttribute("Beta", DoubleValue(4.5));
450
451 plot.AddDataset(Histogram(x7, probes, precision, "GammaRandomVariable a=2.5 b=4.5"));
452
453 plot.AddDataset(Gnuplot2dFunction("{/Symbol g}(x, 2.5, 4.5)", "GammaDist(x, 2.5, 4.5)"));
454
455 gnuplots.AddPlot(plot);
456 }
457
458 {
459 Gnuplot plot;
460 plot.SetTitle("ErlangRandomVariable");
461 plot.AppendExtra("set xrange [0:10]");
462 plot.AppendExtra("ErlangDist(x,k,l) = x**(k-1) * 1/l**k * exp(-x/l) / (k-1)!");
463
464 plot.AppendExtra("set label 1 'Erlang(x,k,{/Symbol l}) = x^{k-1} e^{-x {/Symbol l}^{-1}} ( "
465 "{/Symbol l}^k (k-1)! )^{-1}' at 0.7, 0.9");
466
467 Ptr<ErlangRandomVariable> x1 = CreateObject<ErlangRandomVariable>();
468 x1->SetAttribute("K", IntegerValue(1));
469 x1->SetAttribute("Lambda", DoubleValue(1.0));
470
471 plot.AddDataset(
472 Histogram(x1, probes, precision, "ErlangRandomVariable k=1 {/Symbol l}=1.0"));
473
474 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 1, 1.0)", "ErlangDist(x, 1, 1.0)"));
475
476 Ptr<ErlangRandomVariable> x2 = CreateObject<ErlangRandomVariable>();
477 x2->SetAttribute("K", IntegerValue(2));
478 x2->SetAttribute("Lambda", DoubleValue(1.0));
479
480 plot.AddDataset(
481 Histogram(x2, probes, precision, "ErlangRandomVariable k=2 {/Symbol l}=1.0"));
482
483 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 2, 1.0)", "ErlangDist(x, 2, 1.0)"));
484
485 Ptr<ErlangRandomVariable> x3 = CreateObject<ErlangRandomVariable>();
486 x3->SetAttribute("K", IntegerValue(3));
487 x3->SetAttribute("Lambda", DoubleValue(1.0));
488
489 plot.AddDataset(
490 Histogram(x3, probes, precision, "ErlangRandomVariable k=3 {/Symbol l}=1.0"));
491
492 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 3, 1.0)", "ErlangDist(x, 3, 1.0)"));
493
494 Ptr<ErlangRandomVariable> x4 = CreateObject<ErlangRandomVariable>();
495 x4->SetAttribute("K", IntegerValue(5));
496 x4->SetAttribute("Lambda", DoubleValue(1.0));
497
498 plot.AddDataset(
499 Histogram(x4, probes, precision, "ErlangRandomVariable k=5 {/Symbol l}=1.0"));
500
501 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 5, 1.0)", "ErlangDist(x, 5, 1.0)"));
502
503 Ptr<ErlangRandomVariable> x5 = CreateObject<ErlangRandomVariable>();
504 x5->SetAttribute("K", IntegerValue(2));
505 x5->SetAttribute("Lambda", DoubleValue(2.0));
506
507 plot.AddDataset(
508 Histogram(x5, probes, precision, "ErlangRandomVariable k=2 {/Symbol l}=2.0"));
509
510 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 2, 2.0)", "ErlangDist(x, 2, 2.0)"));
511
512 Ptr<ErlangRandomVariable> x6 = CreateObject<ErlangRandomVariable>();
513 x6->SetAttribute("K", IntegerValue(2));
514 x6->SetAttribute("Lambda", DoubleValue(3.0));
515
516 plot.AddDataset(
517 Histogram(x6, probes, precision, "ErlangRandomVariable k=2 {/Symbol l}=3.0"));
518
519 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 2, 3.0)", "ErlangDist(x, 2, 3.0)"));
520
521 Ptr<ErlangRandomVariable> x7 = CreateObject<ErlangRandomVariable>();
522 x7->SetAttribute("K", IntegerValue(2));
523 x7->SetAttribute("Lambda", DoubleValue(5.0));
524
525 plot.AddDataset(
526 Histogram(x7, probes, precision, "ErlangRandomVariable k=2 {/Symbol l}=5.0"));
527
528 plot.AddDataset(Gnuplot2dFunction("Erlang(x, 2, 5.0)", "ErlangDist(x, 2, 5.0)"));
529
530 gnuplots.AddPlot(plot);
531 }
532
533 gnuplots.GenerateOutput(std::cout);
534
535 return 0;
536}
Parse command-line arguments.
Definition: command-line.h:232
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
Class to represent a 2D points plot.
Definition: gnuplot.h:116
Class to represent a 2D function expression plot.
Definition: gnuplot.h:244
a simple class to group together multiple gnuplots into one file, e.g.
Definition: gnuplot.h:484
Abstract class to store a plot line to be used by ns3::Gnuplot.
Definition: gnuplot.h:39
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Definition: gnuplot.h:370
void AddDataset(const GnuplotDataset &dataset)
Definition: gnuplot.cc:796
void AppendExtra(const std::string &extra)
Definition: gnuplot.cc:789
void SetTitle(const std::string &title)
Definition: gnuplot.cc:770
Class used to store data and make an histogram of the data frequency.
Definition: histogram.h:46
Hold a signed integer type.
Definition: integer.h:45
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:258
virtual double GetValue()=0
Get the next random value as a double drawn from the distribution.
static double dround(double number, double precision)
Round a double number to the given precision.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
cmd
Definition: second.py:33
uint8_t data[writeSize]