 A Discrete-Event Network Simulator Home Tutorials  ▼ Docs    ▼ Develop ▼ API
ns3::GammaVariable Class Reference

Gamma Distributed Random VariableGammaVariable defines a random variable with gamma distribution. More...

#include <random-variable.h> Inheritance diagram for ns3::GammaVariable: Collaboration diagram for ns3::GammaVariable:

## 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... Public Member Functions inherited from ns3::RandomVariable
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...

RandomVariableoperator= (const RandomVariable &o)

## Additional Inherited Members Protected Member Functions inherited from ns3::RandomVariable
RandomVariable (const RandomVariableBase &variable)

RandomVariableBasePeek (void) const

## Detailed Description

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.

## Constructor & Destructor Documentation

 ns3::GammaVariable::GammaVariable ( )

Constructs a gamma random variable with alpha = 1.0 and beta = 1.0.

Definition at line 1625 of file random-variable.cc.

References NS_LOG_FUNCTION.

 ns3::GammaVariable::GammaVariable ( double alpha, double beta )
Parameters
 alpha alpha parameter of the gamma distribution beta beta parameter of the gamma distribution

Definition at line 1631 of file random-variable.cc.

References NS_LOG_FUNCTION.

## Member Function Documentation

 double ns3::GammaVariable::GetValue ( void ) const
Returns
A floating point random value

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 1637 of file random-variable.cc.

References ns3::RandomVariable::GetValue(), and NS_LOG_FUNCTION. Here is the call graph for this function:

 double ns3::GammaVariable::GetValue ( double alpha, double beta ) const

Returns a gamma random distributed double with parameters alpha and beta.

Parameters
 alpha alpha parameter of the gamma distribution beta beta parameter of the gamma distribution
Returns
A floating point random value

Definition at line 1643 of file random-variable.cc.

References NS_LOG_FUNCTION, and ns3::RandomVariable::Peek(). Here is the call graph for this function:

The documentation for this class was generated from the following files: