57 .SetGroupName (
"Core")
58 .AddAttribute(
"Stream",
59 "The stream number for this RNG stream. -1 means \"allocate a stream automatically\". " 60 "Note that if -1 is set, Get will return -1 so that it is not possible to know which " 61 "value was automatically allocated.",
65 MakeIntegerChecker<int64_t>())
66 .AddAttribute(
"Antithetic",
"Set this RNG stream to generate antithetic values",
119 uint64_t base = ((1ULL)<<63);
120 uint64_t target = base + stream;
146 static TypeId tid =
TypeId (
"ns3::UniformRandomVariable")
148 .SetGroupName (
"Core")
150 .AddAttribute(
"Min",
"The lower bound on the values returned by this RNG stream.",
153 MakeDoubleChecker<double>())
154 .AddAttribute(
"Max",
"The upper bound on the values returned by this RNG stream.",
157 MakeDoubleChecker<double>())
196 return static_cast<uint32_t
> (
GetValue ((
double) (
min), (
double) (
max) + 1.0) );
209 return (uint32_t)
GetValue (m_min, m_max + 1);
217 static TypeId tid =
TypeId (
"ns3::ConstantRandomVariable")
219 .SetGroupName (
"Core")
221 .AddAttribute(
"Constant",
"The constant value returned by this RNG stream.",
224 MakeDoubleChecker<double>())
272 static TypeId tid =
TypeId (
"ns3::SequentialRandomVariable")
274 .SetGroupName (
"Core")
276 .AddAttribute(
"Min",
"The first value of the sequence.",
279 MakeDoubleChecker<double>())
280 .AddAttribute(
"Max",
"One more than the last value of the sequence.",
283 MakeDoubleChecker<double>())
284 .AddAttribute(
"Increment",
"The sequence random variable increment.",
285 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"),
287 MakePointerChecker<RandomVariableStream> ())
288 .AddAttribute(
"Consecutive",
"The number of times each member of the sequence is repeated.",
291 MakeIntegerChecker<uint32_t>());
298 m_currentConsecutive (0),
299 m_isCurrentSet (false)
372 static TypeId tid =
TypeId (
"ns3::ExponentialRandomVariable")
374 .SetGroupName (
"Core")
376 .AddAttribute(
"Mean",
"The mean of the values returned by this RNG stream.",
379 MakeDoubleChecker<double>())
380 .AddAttribute(
"Bound",
"The upper bound on the values returned by this RNG stream.",
383 MakeDoubleChecker<double>())
420 double r = -mean*std::log (v);
423 if (bound == 0 || r <= bound)
433 return static_cast<uint32_t
> (
GetValue (mean, bound) );
454 static TypeId tid =
TypeId (
"ns3::ParetoRandomVariable")
456 .SetGroupName (
"Core")
458 .AddAttribute(
"Mean",
"The mean parameter for the Pareto distribution returned by this RNG stream.",
461 MakeDoubleChecker<double>(),
463 "Not anymore used. Use 'Scale' instead - changing this attribute has no effect.")
464 .AddAttribute(
"Scale",
"The scale parameter for the Pareto distribution returned by this RNG stream.",
467 MakeDoubleChecker<double>())
468 .AddAttribute(
"Shape",
"The shape parameter for the Pareto distribution returned by this RNG stream.",
471 MakeDoubleChecker<double>())
472 .AddAttribute(
"Bound",
"The upper bound on the values returned by this RNG stream (if non-zero).",
475 MakeDoubleChecker<double>())
492 double mean = std::numeric_limits<double>::infinity();
539 double r = (scale * ( 1.0 / std::pow (v, 1.0 / shape)));
542 if (bound == 0 || r <= bound)
552 return static_cast<uint32_t
> (
GetValue (scale, shape, bound) );
573 static TypeId tid =
TypeId (
"ns3::WeibullRandomVariable")
575 .SetGroupName (
"Core")
577 .AddAttribute(
"Scale",
"The scale parameter for the Weibull distribution returned by this RNG stream.",
580 MakeDoubleChecker<double>())
581 .AddAttribute(
"Shape",
"The shape parameter for the Weibull distribution returned by this RNG stream.",
584 MakeDoubleChecker<double>())
585 .AddAttribute(
"Bound",
"The upper bound on the values returned by this RNG stream.",
588 MakeDoubleChecker<double>())
622 double exponent = 1.0 / shape;
633 double r = scale * std::pow ( -std::log (v), exponent);
636 if (bound == 0 || r <= bound)
646 return static_cast<uint32_t
> (
GetValue (scale, shape, bound) );
669 static TypeId tid =
TypeId (
"ns3::NormalRandomVariable")
671 .SetGroupName (
"Core")
673 .AddAttribute(
"Mean",
"The mean value for the normal distribution returned by this RNG stream.",
676 MakeDoubleChecker<double>())
677 .AddAttribute(
"Variance",
"The variance value for the normal distribution returned by this RNG stream.",
680 MakeDoubleChecker<double>())
681 .AddAttribute(
"Bound",
"The bound on the values returned by this RNG stream.",
684 MakeDoubleChecker<double>())
736 double v1 = 2 * u1 - 1;
737 double v2 = 2 * u2 - 1;
738 double w = v1 * v1 + v2 * v2;
741 double y = std::sqrt ((-2 * std::log (w)) / w);
742 m_next = mean + v2 * y * std::sqrt (variance);
745 double x1 = mean + v1 * y * std::sqrt (variance);
747 if (std::fabs (x1 - mean) <= bound)
766 return static_cast<uint32_t
> (
GetValue (mean, variance, bound) );
787 static TypeId tid =
TypeId (
"ns3::LogNormalRandomVariable")
789 .SetGroupName (
"Core")
791 .AddAttribute(
"Mu",
"The mu value for the log-normal distribution returned by this RNG stream.",
794 MakeDoubleChecker<double>())
795 .AddAttribute(
"Sigma",
"The sigma value for the log-normal distribution returned by this RNG stream.",
798 MakeDoubleChecker<double>())
871 r2 = v1 * v1 + v2 * v2;
873 while (r2 > 1.0 || r2 == 0);
875 normal = v1 * std::sqrt (-2.0 * std::log (r2) / r2);
877 x = std::exp (sigma *
normal + mu);
886 return static_cast<uint32_t
> (
GetValue (mu, sigma));
909 .SetGroupName (
"Core")
911 .AddAttribute(
"Alpha",
"The alpha value for the gamma distribution returned by this RNG stream.",
914 MakeDoubleChecker<double>())
915 .AddAttribute(
"Beta",
"The beta value for the gamma distribution returned by this RNG stream.",
918 MakeDoubleChecker<double>())
975 double d =
alpha - 1.0 / 3.0;
976 double c = (1.0 / 3.0) / std::sqrt (d);
985 double variance = 1.0;
999 if (u < 1 - 0.0331 *
x *
x *
x *
x)
1003 if (std::log (u) < 0.5 *
x *
x + d * (1 - v + std::log (v)))
1009 return beta * d * v;
1052 double v1 = 2 * u1 - 1;
1053 double v2 = 2 * u2 - 1;
1054 double w = v1 * v1 + v2 * v2;
1057 double y = std::sqrt ((-2 * std::log (w)) / w);
1058 m_next = mean + v2 * y * std::sqrt (variance);
1061 double x1 = mean + v1 * y * std::sqrt (variance);
1063 if (std::fabs (x1 - mean) <= bound)
1083 static TypeId tid =
TypeId (
"ns3::ErlangRandomVariable")
1085 .SetGroupName (
"Core")
1087 .AddAttribute(
"K",
"The k value for the Erlang distribution returned by this RNG stream.",
1090 MakeIntegerChecker<uint32_t>())
1091 .AddAttribute(
"Lambda",
"The lambda value for the Erlang distribution returned by this RNG stream.",
1094 MakeDoubleChecker<double>())
1133 double mean = lambda;
1137 for (
unsigned int i = 0; i < k; ++i)
1150 return static_cast<uint32_t
> (
GetValue (k, lambda));
1180 double r = -mean*std::log (v);
1183 if (bound == 0 || r <= bound)
1195 static TypeId tid =
TypeId (
"ns3::TriangularRandomVariable")
1197 .SetGroupName (
"Core")
1199 .AddAttribute(
"Mean",
"The mean value for the triangular distribution returned by this RNG stream.",
1202 MakeDoubleChecker<double>())
1203 .AddAttribute(
"Min",
"The lower bound on the values returned by this RNG stream.",
1206 MakeDoubleChecker<double>())
1207 .AddAttribute(
"Max",
"The upper bound on the values returned by this RNG stream.",
1210 MakeDoubleChecker<double>())
1245 double mode = 3.0 * mean -
min -
max;
1257 return min + std::sqrt (u * (
max -
min) * (mode -
min) );
1261 return max - std::sqrt ( (1 - u) * (
max -
min) * (
max - mode) );
1292 .SetGroupName (
"Core")
1294 .AddAttribute(
"N",
"The n value for the Zipf distribution returned by this RNG stream.",
1297 MakeIntegerChecker<uint32_t>())
1298 .AddAttribute(
"Alpha",
"The alpha value for the Zipf distribution returned by this RNG stream.",
1301 MakeDoubleChecker<double>())
1330 for (uint32_t i = 1; i <=
n; i++)
1332 m_c += (1.0 / std::pow ((
double)i,
alpha));
1343 double sum_prob = 0,zipf_value = 0;
1344 for (uint32_t i = 1; i <=
m_n; i++)
1346 sum_prob +=
m_c / std::pow ((
double)i,
m_alpha);
1383 .SetGroupName (
"Core")
1385 .AddAttribute(
"Alpha",
"The alpha value for the zeta distribution returned by this RNG stream.",
1388 MakeDoubleChecker<double>())
1431 X = std::floor (std::pow (u, -1.0 / (
m_alpha - 1.0)));
1432 T = std::pow (1.0 + 1.0 / X,
m_alpha - 1.0);
1433 test = v * X * (T - 1.0) / (
m_b - 1.0);
1435 while ( test > (T /
m_b) );
1465 static TypeId tid =
TypeId (
"ns3::DeterministicRandomVariable")
1467 .SetGroupName (
"Core")
1501 m_data =
new double[length];
1506 for (std::size_t i = 0; i <
m_count; i++)
1559 static TypeId tid =
TypeId (
"ns3::EmpiricalRandomVariable")
1561 .SetGroupName (
"Core")
1591 if (r <=
m_emp.front ().cdf)
1593 return m_emp.front ().value;
1595 if (r >=
m_emp.back ().cdf)
1597 return m_emp.back ().value;
1600 std::vector<ValueCDF>::size_type bottom = 0;
1601 std::vector<ValueCDF>::size_type top =
m_emp.size () - 1;
1604 std::vector<ValueCDF>::size_type c = (top + bottom) / 2;
1605 if (r >=
m_emp[c].cdf && r <
m_emp[c + 1].cdf)
1612 if (r <
m_emp[c].cdf)
1645 for (std::vector<ValueCDF>::size_type i = 0; i <
m_emp.size (); ++i)
1650 std::cerr <<
"Empirical Dist error," 1651 <<
" current value " << current.
value 1652 <<
" prior value " << prior.
value 1653 <<
" current cdf " << current.
cdf 1654 <<
" prior cdf " << prior.
cdf << std::endl;
1659 if (prior.
cdf != 1.0)
1667 double v1,
double v2,
double r)
1670 return (v1 + ((v2 - v1) / (c2 - c1)) * (r - c1));
The Random Number Generator (RNG) that returns a predetermined sequence.
double m_scale
The scale parameter for the Weibull distribution returned by this RNG stream.
double m_current
The current sequence value.
ExponentialRandomVariable()
Creates an exponential distribution RNG with the default values for the mean and upper bound...
ns3::BooleanValue attribute value declarations.
ns3::DoubleValue attribute value declarations and template implementations.
std::vector< ValueCDF > m_emp
The vector of CDF points.
double GetBound(void) const
Get the configured upper bound of this RNG.
double GetAlpha(void) const
Returns the alpha value for the Zipf distribution returned by this RNG stream.
double m_next
The algorithm produces two values at a time.
void SetAntithetic(bool isAntithetic)
Specify whether antithetic values should be generated.
NormalRandomVariable()
Creates a normal distribution RNG with the default values for the mean, variance, and bound...
virtual double GetValue(void)
Returns the next value in the empirical distribution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
WeibullRandomVariable()
Creates a Weibull distribution RNG with the default values for the scale, shape, and upper bound...
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a Weibull distribution with the current scale, shape, and upper bound.
double GetMin(void) const
Get the first value of the sequence.
AttributeValue implementation for Boolean.
virtual double GetValue(void)
Get the next random value as a double drawn from the distribution.
bool m_validated
true once the CDF has been validated.
double m_alpha
The alpha value for the Zipf distribution returned by this RNG stream.
double m_mean
The mean value for the triangular distribution returned by this RNG stream.
SequentialRandomVariable()
Creates a sequential RNG with the default values for the sequence parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
double m_bound
The upper bound on values that can be returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
Hold variables of type string.
double GetMean(void) const
Returns the mean value for the triangular distribution returned by this RNG stream.
ns3::StringValue attribute value declarations.
The exponential distribution Random Number Generator (RNG).
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a triangular distribution with the current mean...
The Random Number Generator (RNG) that returns a pattern of sequential values.
RandomVariableStream()
Default constructor.
double GetMax(void) const
Returns the upper bound on values that can be returned by this RNG stream.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
The normal (Gaussian) distribution Random Number Generator (RNG) that allows stream numbers to be set...
std::size_t m_count
Size of the array of values.
double GetExponentialValue(double mean, double bound)
Returns a random double from an exponential distribution with the specified mean and upper bound...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Hold a signed integer type.
double m_mean
The mean parameter for the Pareto distribution returned by this RNG stream.
double value
The argument value.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual double GetValue(void)
Returns a random double from a normal distribution with the current mean, variance, and bound.
#define NS_UNUSED(x)
Mark a local variable as unused.
virtual ~DeterministicRandomVariable()
static TypeId GetTypeId(void)
Register this type.
double m_shape
The shape parameter for the Weibull distribution returned by this RNG stream.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
int64_t m_stream
The stream number for the RngStream.
virtual double Interpolate(double c1, double c2, double v1, double v2, double r)
Linear nterpolation between two points on the CDF to estimate the value at r.
double GetShape(void) const
Returns the shape parameter for the Weibull distribution returned by this RNG stream.
double m_constant
The constant value returned by this RNG stream.
double m_min
The first value of the sequence.
Ptr< RandomVariableStream > m_increment
Increment between distinct values.
bool m_nextValid
True if the next value is valid.
virtual double GetValue(void)=0
Get the next random value as a double drawn from the distribution.
static uint64_t GetRun(void)
Get the current run number.
void SetValueArray(double *values, std::size_t length)
Sets the array of values that holds the predetermined sequence.
double GetLambda(void) const
Returns the lambda value for the Erlang distribution returned by this RNG stream. ...
static TypeId GetTypeId(void)
Register this type.
static TypeId GetTypeId(void)
Register this type.
double m_bound
The upper bound on values that can be returned by this RNG stream.
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
DeterministicRandomVariable()
Creates a deterministic RNG that will have a predetermined sequence of values.
static TypeId GetTypeId(void)
Register this type.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a gamma distribution with the current alpha and beta...
double m_shape
The shape parameter for the Pareto distribution returned by this RNG stream.
uint32_t m_n
The n value for the Zipf distribution returned by this RNG stream.
virtual double GetValue(void)
Get the next random value as a double drawn from the distribution.
RngStream * m_rng
Pointer to the underlying RngStream.
Combined Multiple-Recursive Generator MRG32k3a.
virtual void Validate()
Check that the CDF is valid.
double * m_data
Array of values to return in sequence.
virtual uint32_t GetInteger(void)=0
Get the next random value as an integer drawn from the distribution.
double m_lambda
The lambda value for the Erlang distribution returned by this RNG stream.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Ptr< RandomVariableStream > GetIncrement(void) const
Get the increment for the sequence.
double m_alpha
The alpha value for the zeta distribution returned by this RNG stream.
virtual double GetValue(void)
Returns the next value in the sequence.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a Pareto distribution with the current mean, shape, and upper bound.
LogNormalRandomVariable()
Creates a log-normal distribution RNG with the default values for mu and sigma.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a log-normal distribution with the current mu and sigma...
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
ns3::RngSeedManager declaration.
double m_max
Strict upper bound on the sequence.
ZetaRandomVariable()
Creates a zeta distribution RNG with the default value for alpha.
uint32_t m_k
The k value for the Erlang distribution returned by this RNG stream.
The gamma distribution Random Number Generator (RNG) that allows stream numbers to be set determinist...
static TypeId GetTypeId(void)
Register this type.
virtual double GetValue(void)
Returns a random double from a triangular distribution with the current mean, min, and max.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a Zipf distribution with the current n and alpha...
void CDF(double v, double c)
Specifies a point in the empirical distribution.
double GetBeta(void) const
Returns the beta value for the gamma distribution returned by this RNG stream.
Helper to hold one point of the CDF.
virtual uint32_t GetInteger(void)
Get the next random value as an integer drawn from the distribution.
double m_sigma
The sigma value for the log-normal distribution returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
ZipfRandomVariable()
Creates a Zipf distribution RNG with the default values for n and alpha.
static TypeId GetTypeId(void)
Register this type.
static TypeId GetTypeId(void)
Register this type.
GammaRandomVariable()
Creates a gamma distribution RNG with the default values for alpha and beta.
double m_scale
The scale parameter for the Pareto distribution returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
double GetAlpha(void) const
Returns the alpha value for the gamma distribution returned by this RNG stream.
double m_c
The normalization constant.
uint32_t m_consecutive
The number of times each distinct value is repeated.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a normal distribution with the current mean, variance, and bound.
double m_variance
The variance value for the normal distribution returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
double m_mean
The mean value of the unbounded exponential distribution.
int64_t GetStream(void) const
Returns the stream number for the RngStream.
double GetScale(void) const
Returns the scale parameter for the Pareto distribution returned by this RNG stream.
double GetScale(void) const
Returns the scale parameter for the Weibull distribution returned by this RNG stream.
double cdf
The CDF at value.
virtual double GetValue(void)
Returns a random double from a Zipf distribution with the current n and alpha.
virtual double GetValue(void)
Get the next random value as a double drawn from the distribution.
bool m_isCurrentSet
Indicates if the current sequence value has been properly initialized.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual double GetValue(void)
Returns a random double from an Erlang distribution with the current k and lambda.
ns3::RngStream declaration.
double GetMean(void) const
Returns the mean value for the normal distribution returned by this RNG stream.
double m_mean
The mean value for the normal distribution returned by this RNG stream.
static const double INFINITE_VALUE
Large constant to bound the range.
static TypeId GetTypeId(void)
Register this type.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
uint32_t m_currentConsecutive
The number of times the current distinct value has been repeated.
virtual uint32_t GetInteger(void)
Get the next random value as an integer drawn from the distribution.
double m_bound
The upper bound on values that can be returned by this RNG stream.
EmpiricalRandomVariable()
Creates an empirical RNG that has a specified, empirical distribution.
double m_beta
The beta value for the gamma distribution returned by this RNG stream.
double GetMin(void) const
Returns the lower bound for the triangular distribution returned by this RNG stream.
double RandU01(void)
Generate the next random number for this stream.
double GetAlpha(void) const
Returns the alpha value for the zeta distribution returned by this RNG stream.
virtual double GetValue(void)
Returns a random double from a Weibull distribution with the current scale, shape, and upper bound.
double m_alpha
The alpha value for the gamma distribution returned by this RNG stream.
double GetBound(void) const
Returns the upper bound on values that can be returned by this RNG stream.
bool IsAntithetic(void) const
Check if antithetic values will be generated.
virtual uint32_t GetInteger(void)
Returns the next value in the sequence.
double GetConstant(void) const
Get the constant value returned by this RNG stream.
static uint32_t GetSeed(void)
Get the current seed value which will be used by all subsequently instantiated RandomVariableStream o...
double GetNormalValue(double mean, double variance, double bound)
Returns a random double from a normal distribution with the specified mean, variance, and bound.
double GetBound(void) const
Returns the bound on values that can be returned by this RNG stream.
virtual double GetValue(void)
Returns a random double from a log-normal distribution with the current mu and sigma.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
NS_DEPRECATED double GetMean(void) const
Returns the mean parameter for the Pareto distribution returned by this RNG stream.
uint32_t GetConsecutive(void) const
Get the number of times each distinct value of the sequence is repeated before incrementing to the ne...
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a zeta distribution with the current alpha.
ParetoRandomVariable()
Creates a Pareto distribution RNG with the default values for the mean, the shape, and upper bound.
The Zipf distribution Random Number Generator (RNG) that allows stream numbers to be set deterministi...
The basic uniform Random Number Generator (RNG).
virtual uint32_t GetInteger(void)
Get the next random value as an integer drawn from the distribution.
ns3::RandomVariableStream declaration, and related classes.
virtual double GetValue(void)
Returns a random double from a zeta distribution with the current alpha.
virtual uint32_t GetInteger(void)
Returns the next value in the empirical distribution.
ns3::IntegerValue attribute value declarations and template implementations.
double m_bound
The bound on values that can be returned by this RNG stream.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from an Erlang distribution with the current k and lambda...
Attribute or trace source is deprecated; user is warned.
virtual ~RandomVariableStream()
Destructor.
double GetMax(void) const
Get the limit of the sequence, which is (at least) one more than the last value of the sequence...
double m_next
The algorithm produces two normal values at a time.
double GetVariance(void) const
Returns the variance value for the normal distribution returned by this RNG stream.
double m_b
Just for calculus simplifications.
The triangular distribution Random Number Generator (RNG) that allows stream numbers to be set determ...
static TypeId GetTypeId(void)
Register this type.
double m_max
The upper bound on values that can be returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
ErlangRandomVariable()
Creates an Erlang distribution RNG with the default values for k and lambda.
bool m_nextValid
True if the next normal value is valid.
The Erlang distribution Random Number Generator (RNG) that allows stream numbers to be set determinis...
uint32_t GetN(void) const
Returns the n value for the Zipf distribution returned by this RNG stream.
A base class which provides memory management and object aggregation.
virtual double GetValue(void)
Returns a random double from a Pareto distribution with the current mean, shape, and upper bound...
static uint64_t GetNextStreamIndex(void)
Get the next automatically assigned stream index.
double GetMean(void) const
Get the configured mean value of this RNG.
The Random Number Generator (RNG) that has a specified empirical distribution.
uint32_t GetK(void) const
Returns the k value for the Erlang distribution returned by this RNG stream.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
std::size_t m_next
Position of the next value in the array of values.
double GetMu(void) const
Returns the mu value for the log-normal distribution returned by this RNG stream. ...
virtual double GetValue(void)
Returns a random double from a gamma distribution with the current alpha and beta.
ns3::PointerValue attribute value declarations and template implementations.
The log-normal distribution Random Number Generator (RNG) that allows stream numbers to be set determ...
a unique identifier for an interface.
TriangularRandomVariable()
Creates a triangular distribution RNG with the default values for the mean, lower bound...
TypeId SetParent(TypeId tid)
Set the parent TypeId.
ConstantRandomVariable()
Creates a constant RNG with the default constant value.
The Pareto distribution Random Number Generator (RNG).
static TypeId GetTypeId(void)
Register this type.
double m_mu
The mu value for the log-normal distribution returned by this RNG stream.
double GetSigma(void) const
Returns the sigma value for the log-normal distribution returned by this RNG stream.
double m_min
The lower bound on values that can be returned by this RNG stream.
The Random Number Generator (RNG) that returns a constant.
The Weibull distribution Random Number Generator (RNG) that allows stream numbers to be set determini...
The zeta distribution Random Number Generator (RNG) that allows stream numbers to be set deterministi...
double GetShape(void) const
Returns the shape parameter for the Pareto distribution returned by this RNG stream.
RngStream * Peek(void) const
Get the pointer to the underlying RngStream.
double GetBound(void) const
Returns the upper bound on values that can be returned by this RNG stream.
bool m_isAntithetic
Indicates if antithetic values should be generated by this RNG stream.
NS_UNUSED and NS_UNUSED_GLOBAL macro definitions.