The uniform distribution RNG for NS-3.This class supports the creation of objects that return random numbers from a fixed uniform distribution. It also supports the generation of single random numbers from various uniform distributions. More...
#include <random-variable.h>
Public Member Functions | |
UniformVariable () | |
UniformVariable (double s, double l) | |
Static Public Member Functions | |
static double | GetSingleValue (double s, double l) |
The uniform distribution RNG for NS-3.
This class supports the creation of objects that return random numbers from a fixed uniform distribution. It also supports the generation of single random numbers from various uniform distributions.
The low end of the range is always included and the high end of the range is always excluded.
UniformVariable x(0,10); x.GetValue(); //will always return numbers [0,10) UniformVariable::GetSingleValue(100,1000); //returns a value [100,1000)
Definition at line 192 of file random-variable.h.
ns3::UniformVariable::UniformVariable | ( | ) |
Creates a uniform random number generator in the range [0.0 .. 1.0).
Definition at line 404 of file random-variable.cc.
ns3::UniformVariable::UniformVariable | ( | double | s, | |
double | l | |||
) |
Creates a uniform random number generator with the specified range
s | Low end of the range | |
l | High end of the range |
Definition at line 407 of file random-variable.cc.
double ns3::UniformVariable::GetSingleValue | ( | double | s, | |
double | l | |||
) | [static] |
s | Low end of the range | |
l | High end of the range |
Definition at line 411 of file random-variable.cc.
Referenced by ns3::Backoff::GetBackoffTime(), ns3::RandomDirection2dMobilityModel::ResetDirectionAndSpeed(), and ns3::RandomDirection2dMobilityModel::Start().