Gamma Distributed Random VariableGammaVariable defines a random variable with gamma distribution. More...
#include <random-variable.h>
Public Member Functions | |
GammaVariable () | |
Constructs a gamma random variable with alpha = 1.0 and beta = 1.0. More... | |
GammaVariable (double alpha, double beta) | |
double | GetValue (void) const |
call RandomVariable::GetValue More... | |
double | GetValue (double alpha, double beta) const |
Returns a gamma random distributed double with parameters alpha and beta. More... | |
![]() | |
RandomVariable () | |
RandomVariable (const RandomVariable &o) | |
~RandomVariable () | |
uint32_t | GetInteger (void) const |
Returns a random integer integer from the underlying distribution. More... | |
double | GetValue (void) const |
Returns a random double from the underlying distribution. More... | |
RandomVariable & | operator= (const RandomVariable &o) |
Additional Inherited Members | |
![]() | |
RandomVariable (const RandomVariableBase &variable) | |
RandomVariableBase * | Peek (void) const |
Gamma Distributed Random Variable
GammaVariable defines a random variable with gamma distribution.
This class supports the creation of objects that return random numbers from a fixed gamma distribution. It also supports the generation of single random numbers from various gamma distributions.
The probability density function is defined over the interval [0,+inf) as: where
and
Definition at line 571 of file random-variable.h.
ns3::GammaVariable::GammaVariable | ( | ) |
Constructs a gamma random variable with alpha = 1.0 and beta = 1.0.
Definition at line 1626 of file random-variable.cc.
References NS_LOG_FUNCTION.
ns3::GammaVariable::GammaVariable | ( | double | alpha, |
double | beta | ||
) |
alpha | alpha parameter of the gamma distribution |
beta | beta parameter of the gamma distribution |
Definition at line 1632 of file random-variable.cc.
References NS_LOG_FUNCTION.
double ns3::GammaVariable::GetValue | ( | void | ) | const |
Note: we have to re-implement this method here because the method is overloaded below for the two-argument variant and the c++ name resolution rules don't work well with overloads split between parent and child classes.
Definition at line 1638 of file random-variable.cc.
References ns3::RandomVariable::GetValue(), and NS_LOG_FUNCTION.
double ns3::GammaVariable::GetValue | ( | double | alpha, |
double | beta | ||
) | const |
Returns a gamma random distributed double with parameters alpha and beta.
alpha | alpha parameter of the gamma distribution |
beta | beta parameter of the gamma distribution |
Definition at line 1644 of file random-variable.cc.
References NS_LOG_FUNCTION, and ns3::RandomVariable::Peek().