26 #ifndef RANDOM_VARIABLE_STREAM_H
27 #define RANDOM_VARIABLE_STREAM_H
251 double GetMin (
void)
const;
257 double GetMax (
void)
const;
269 double GetValue (
double min,
double max);
281 uint32_t
GetInteger (uint32_t min, uint32_t max);
417 double GetMin (
void)
const;
424 double GetMax (
void)
const;
574 double GetValue (
double mean,
double bound);
583 uint32_t
GetInteger (uint32_t mean, uint32_t bound);
707 double GetValue (
double mean,
double shape,
double bound);
740 uint32_t
GetInteger (uint32_t mean, uint32_t shape, uint32_t bound);
931 double GetValue (
double scale,
double shape,
double bound);
958 uint32_t
GetInteger (uint32_t scale, uint32_t shape, uint32_t bound);
1169 uint32_t
GetInteger (uint32_t mean, uint32_t variance, uint32_t bound);
1327 double GetMu (
void)
const;
1368 double GetValue (
double mu,
double sigma);
1403 uint32_t
GetInteger (uint32_t mu, uint32_t sigma);
1557 double GetValue (
double alpha,
double beta);
1572 uint32_t
GetInteger (uint32_t alpha, uint32_t beta);
1642 double GetNormalValue (
double mean,
double variance,
double bound);
1713 uint32_t
GetK (
void)
const;
1734 double GetValue (uint32_t k,
double lambda);
1749 uint32_t
GetInteger (uint32_t k, uint32_t lambda);
1871 double GetMin (
void)
const;
1877 double GetMax (
void)
const;
1917 double GetValue (
double mean,
double min,
double max);
1957 uint32_t
GetInteger (uint32_t mean, uint32_t min, uint32_t max);
2128 uint32_t
GetN (
void)
const;
2149 double GetValue (uint32_t n,
double alpha);
2164 uint32_t
GetInteger (uint32_t n, uint32_t alpha);
2471 void CDF (
double v,
double c);
2548 double v1,
double v2,
double r);
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 a exponential distribution RNG with the default values for the mean and upper bound...
double GetSigma(void) const
Returns the sigma value for the log-normal distribution returned by this RNG stream.
double m_next
The algorithm produces two values at a time.
double GetAlpha(void) const
Returns the alpha value for the Zipf distribution returned by this RNG stream.
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.
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
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 GetAlpha(void) const
Returns the alpha value for the gamma distribution returned by this RNG stream.
virtual double GetValue(void)
Get the next random value as a double drawn from the distribution.
double m_alpha
The alpha value for the Zipf distribution returned by this RNG stream.
double GetLambda(void) const
Returns the lambda value for the Erlang distribution returned by this RNG stream. ...
double GetBound(void) const
Returns the upper bound on values that can be 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.
double m_bound
The upper bound on values that can be returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
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.
The normal (Gaussian) distribution Random Number Generator (RNG) that allows stream numbers to be set...
uint64_t m_count
Position in 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...
double m_mean
The mean parameter for the Pareto distribution returned by this RNG stream.
double value
The argument value.
virtual double GetValue(void)
Returns a random double from a normal distribution with the current mean, variance, and bound.
virtual ~DeterministicRandomVariable()
static TypeId GetTypeId(void)
Register this type.
double m_shape
The shape parameter for the Weibull distribution returned by this RNG stream.
uint32_t GetN(void) const
Returns the n value for the Zipf distribution returned by this RNG stream.
int64_t m_stream
The stream number for this RNG stream.
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 m_constant
The constant value returned by this RNG stream.
double m_min
The first value of the sequence.
double GetConstant(void) const
Get the constant value returned by this RNG stream.
double GetMin(void) const
Get 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 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.
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.
int64_t GetStream(void) const
Returns the stream number for 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 RNG stream.
Combined Multiple-Recursive Generator MRG32k3a.
virtual void Validate()
Check that the CDF is valid.
double * m_data
Array of values to return in sequence.
Ptr< RandomVariableStream > GetIncrement(void) const
Get the increment for the 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.
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.
double GetScale(void) const
Returns the scale parameter for the Weibull distribution returned by this RNG stream.
virtual uint32_t GetInteger(void)
Returns a random unsigned integer from a log-normal distribution with the current mu and sigma...
double GetMin(void) const
Returns the lower bound for the triangular distribution returned by this RNG stream.
uint32_t GetK(void) const
Returns the k value for the Erlang distribution returned by this RNG stream.
double m_max
Strict upper bound on the sequence.
uint32_t GetConsecutive(void) const
Get the number of times each distinct value of the sequence is repeated before incrementing to the ne...
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.
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 GetMu(void) const
Returns the mu value for the log-normal distribution returned by this RNG stream. ...
uint64_t m_next
Position of the next value in the array of values.
static TypeId GetTypeId(void)
Register this type.
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 GetMax(void) const
Returns the upper bound on values that can be returned by this RNG stream.
double m_variance
The variance value for the normal distribution returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
double GetMean(void) const
Get the configured mean value of this RNG.
double m_mean
The mean value of the unbounded exponential distribution.
double GetVariance(void) const
Returns the variance value for the normal 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.
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.
uint32_t m_currentConsecutive
The number of times the current distinct value has been repeated.
ns3::TypeId declaration; inline and template implementations.
double GetMean(void) const
Returns the mean value for the normal distribution returned by this RNG stream.
void SetValueArray(double *values, uint64_t length)
Sets the array of values that holds the predetermined sequence.
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.
bool IsAntithetic(void) const
Check if antithetic values will be generated.
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.
virtual uint32_t GetInteger(void)
Returns the next value in the sequence.
double GetNormalValue(double mean, double variance, double bound)
Returns a random double from a normal distribution with the specified mean, variance, and bound.
Declaration of Attribute helper macros.
double GetMax(void) const
Get the limit of the sequence, which is (at least) one more than the last value of the sequence...
virtual double GetValue(void)
Returns a random double from a log-normal distribution with the current mu and sigma.
ns3::Object class declaration, which is the root of the Object hierarchy and Aggregation.
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.
double GetBound(void) const
Returns the bound on values that can be returned by this RNG stream.
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.
double GetBound(void) const
Get the configured upper bound of this RNG.
virtual double GetValue(void)
Returns a random double from a zeta distribution with the current alpha.
double GetShape(void) const
Returns the shape parameter for the Weibull distribution returned by this RNG stream.
virtual uint32_t GetInteger(void)
Returns the next value in the empirical distribution.
double m_bound
The bound on values that can be returned by this RNG stream.
double GetMean(void) const
Returns the mean parameter for the Pareto distribution 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...
virtual ~RandomVariableStream()
Destructor.
double m_next
The algorithm produces two normal values at a time.
RngStream * Peek(void) const
Get the pointer to the underlying 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.
double GetBound(void) const
Returns the upper bound on values that can be returned by this RNG stream.
The Erlang distribution Random Number Generator (RNG) that allows stream numbers to be set determinis...
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...
The Random Number Generator (RNG) that has a specified empirical distribution.
double GetBeta(void) const
Returns the beta value for the gamma distribution returned by this RNG stream.
virtual double GetValue(void)
Returns a random double from a gamma distribution with the current alpha and beta.
double GetAlpha(void) const
Returns the alpha value for the zeta distribution returned by this RNG stream.
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...
ConstantRandomVariable()
Creates a constant RNG with the default constant value.
The Pareto distribution Random Number Generator (RNG).
double GetMean(void) const
Returns the mean value for the triangular distribution returned by this RNG stream.
static TypeId GetTypeId(void)
Register this type.
double m_mu
The mu 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.
RandomVariableStream & operator=(const RandomVariableStream &o)
Assignment operator.
bool validated
true once the CDF has been validated.
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.
std::vector< ValueCDF > emp
The vector of CDF points.
bool m_isAntithetic
Indicates if antithetic values should be generated by this RNG stream.