A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ()
 GammaVariable (double alpha, double beta)
double GetValue (void) const
 call RandomVariable::GetValue
double GetValue (double alpha, double beta) const
 Returns a gamma random distributed double with parameters alpha and beta.
- 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.
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: $ x^{\alpha-1} \frac{e^{-\frac{x}{\beta}}}{\beta^\alpha \Gamma(\alpha)}$ where $ mean = \alpha\beta $ and $ variance = \alpha \beta^2$

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

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

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

Member Function Documentation

double ns3::GammaVariable::GetValue ( void  ) const

call RandomVariable::GetValue

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.

Reimplemented from ns3::RandomVariable.

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

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

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

Parameters
alphaalpha parameter of the gamma distribution
betabeta parameter of the gamma distribution
Returns
A floating point random value

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

References ns3::RandomVariable::Peek().

+ Here is the call graph for this function:


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