Example program illustrating use of ns3::EmpiricalRandomVariable. More...
#include "ns3/simulator.h"#include "ns3/nstime.h"#include "ns3/command-line.h"#include "ns3/random-variable-stream.h"#include "ns3/histogram.h"#include "ns3/ptr.h"#include <iomanip>#include <iostream>#include <map>
Include dependency graph for empirical-random-variable-example.cc:Go to the source code of this file.
Functions | |
| void | PrintStatsLine (const double value, const long count, const long n) |
| void | PrintSummary (long sum, long n, double weighted, double expected) |
| void | RunBothModes (std::string mode, Ptr< EmpiricalRandomVariable > erv, long n) |
| void | RunSingleSample (std::string mode, Ptr< EmpiricalRandomVariable > erv) |
Example program illustrating use of ns3::EmpiricalRandomVariable.
This example illustrates
Consult the ns-3 manual for more information about the use of the random number generator
Definition in file empirical-random-variable-example.cc.
| void PrintStatsLine | ( | const double | value, |
| const long | count, | ||
| const long | n | ||
| ) |
Definition at line 72 of file empirical-random-variable-example.cc.
References sample-rng-plot::n.
Referenced by RunBothModes().
Here is the caller graph for this function:| void PrintSummary | ( | long | sum, |
| long | n, | ||
| double | weighted, | ||
| double | expected | ||
| ) |
Definition at line 83 of file empirical-random-variable-example.cc.
References sample-rng-plot::n.
Referenced by RunBothModes().
Here is the caller graph for this function:| void RunBothModes | ( | std::string | mode, |
| Ptr< EmpiricalRandomVariable > | erv, | ||
| long | n | ||
| ) |
Definition at line 104 of file empirical-random-variable-example.cc.
References ns3::Histogram::AddValue(), ns3::Histogram::GetBinCount(), ns3::Histogram::GetBinStart(), ns3::Histogram::GetBinWidth(), ns3::Histogram::GetNBins(), ns3::EmpiricalRandomVariable::GetValue(), sample-rng-plot::n, PrintStatsLine(), PrintSummary(), ns3::EmpiricalRandomVariable::SetInterpolate(), and visualizer.core::start().
Here is the call graph for this function:| void RunSingleSample | ( | std::string | mode, |
| Ptr< EmpiricalRandomVariable > | erv | ||
| ) |
Definition at line 53 of file empirical-random-variable-example.cc.
References ns3::EmpiricalRandomVariable::GetValue(), and ns3::EmpiricalRandomVariable::SetInterpolate().
Here is the call graph for this function: