A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::ParetoVariable Class Reference

ParetoVariable distributed random varThis class supports the creation of objects that return random numbers from a fixed pareto distribution. More...

#include <random-variable.h>

+ Inheritance diagram for ns3::ParetoVariable:
+ Collaboration diagram for ns3::ParetoVariable:

Public Member Functions

 ParetoVariable ()
 Constructs a pareto random variable with a mean of 1 and a shape parameter of 1.5. More...
 
 ParetoVariable (double m)
 Constructs a pareto random variable with specified mean and shape parameter of 1.5. More...
 
 ParetoVariable (double m, double s)
 Constructs a pareto random variable with the specified mean value and shape parameter. More...
 
 ParetoVariable (double m, double s, double b)
 Constructs a pareto random variable with the specified mean value, shape (alpha), and upper bound. More...
 
 ParetoVariable (std::pair< double, double > params)
 Constructs a pareto random variable with the specified scale and shape parameters. More...
 
 ParetoVariable (std::pair< double, double > params, double b)
 Constructs a pareto random variable with the specified scale, shape (alpha), and upper bound. 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

ParetoVariable distributed random var

This class supports the creation of objects that return random numbers from a fixed pareto distribution.

It also supports the generation of single random numbers from various pareto distributions.

The probability density function is defined over the range [ $x_m$,+inf) as: $ k \frac{x_m^k}{x^{k+1}}$ where $x_m > 0$ is called the location parameter and $ k > 0$ is called the pareto index or shape.

The parameter $ x_m $ can be infered from the mean and the parameter $ k $ with the equation $ x_m = mean \frac{k-1}{k}, k > 1$.

x.GetValue (); //will always return with mean 3.14

Definition at line 292 of file random-variable.h.

Constructor & Destructor Documentation

ns3::ParetoVariable::ParetoVariable ( )

Constructs a pareto random variable with a mean of 1 and a shape parameter of 1.5.

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

References NS_LOG_FUNCTION.

ns3::ParetoVariable::ParetoVariable ( double  m)
explicit

Constructs a pareto random variable with specified mean and shape parameter of 1.5.

Parameters
mMean value of the distribution

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

References NS_LOG_FUNCTION.

ns3::ParetoVariable::ParetoVariable ( double  m,
double  s 
)

Constructs a pareto random variable with the specified mean value and shape parameter.

Beware, s must be strictly greater than 1.

Parameters
mMean value of the distribution
sShape parameter for the distribution

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

References NS_LOG_FUNCTION.

ns3::ParetoVariable::ParetoVariable ( double  m,
double  s,
double  b 
)

Constructs a pareto random variable with the specified mean value, shape (alpha), and upper bound.

Beware, s must be strictly greater than 1.

Since pareto distributions can theoretically return unbounded values, it is sometimes useful to specify a fixed upper limit. Note however when the upper limit is specified, the true mean of the distribution is slightly smaller than the mean value specified.

Parameters
mMean value
sShape parameter
bUpper limit on returned values

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

References NS_LOG_FUNCTION.

ns3::ParetoVariable::ParetoVariable ( std::pair< double, double >  params)

Constructs a pareto random variable with the specified scale and shape parameters.

Parameters
paramsthe two parameters, respectively scale and shape, of the distribution

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

References NS_LOG_FUNCTION.

ns3::ParetoVariable::ParetoVariable ( std::pair< double, double >  params,
double  b 
)

Constructs a pareto random variable with the specified scale, shape (alpha), and upper bound.

Since pareto distributions can theoretically return unbounded values, it is sometimes useful to specify a fixed upper limit. Note however when the upper limit is specified, the true mean of the distribution is slightly smaller than the mean value specified.

Parameters
paramsthe two parameters, respectively scale and shape, of the distribution
bUpper limit on returned values

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

References NS_LOG_FUNCTION.


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