 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:

Public Member Functions

GammaVariable ()

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 (const RandomVariable &o)

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) 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 569 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 1612 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 1618 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 1624 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.

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

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

References NS_LOG_FUNCTION.

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