|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
11 #ifndef __OMNETPP_DISTRIB_H
12 #define __OMNETPP_DISTRIB_H
14 #include "simkerneldefs.h"
51 SIM_API
double uniform(cRNG *rng,
double a,
double b);
80 SIM_API
double normal(cRNG *rng,
double mean,
double stddev);
103 SIM_API
double truncnormal(cRNG *rng,
double mean,
double stddev);
145 SIM_API
double gamma_d(cRNG *rng,
double alpha,
double theta);
159 SIM_API
double beta(cRNG *rng,
double alpha1,
double alpha2);
179 SIM_API
double erlang_k(cRNG *rng,
unsigned int k,
double mean);
198 SIM_API
double chi_square(cRNG *rng,
unsigned int k);
211 SIM_API
double student_t(cRNG *rng,
unsigned int i);
227 SIM_API
double cauchy(cRNG *rng,
double a,
double b);
238 SIM_API
double triang(cRNG *rng,
double a,
double b,
double c);
253 return exp(
normal(rng, m, w));
275 SIM_API
double weibull(cRNG *rng,
double a,
double b);
286 SIM_API
double pareto_shifted(cRNG *rng,
double a,
double b,
double c);
304 SIM_API
int intuniform(cRNG *rng,
int a,
int b);
327 return (p > U) ? 1 : 0;
342 SIM_API
int binomial(cRNG *rng,
int n,
double p);
356 SIM_API
int geometric(cRNG *rng,
double p);
370 SIM_API
int negbinomial(cRNG *rng,
int n,
double p);
406 SIM_API
int poisson(cRNG *rng,
double lambda);
SIM_API double chi_square(cRNG *rng, unsigned int k)
Returns a random variate from the chi-square distribution with k degrees of freedom.
SIM_API double gamma_d(cRNG *rng, double alpha, double theta)
Returns a random variate from the gamma distribution with parameters alpha>0, theta>0....
virtual uint32_t intRand()=0
SIM_API double cauchy(cRNG *rng, double a, double b)
Returns a random variate from the Cauchy distribution (also called Lorentzian distribution) with para...
SimTime truncnormal(cRNG *rng, SimTime mean, SimTime stddev)
SimTime version of truncnormal(cRNG*,double,double), for convenience.
Definition: distrib.h:108
SIM_API int geometric(cRNG *rng, double p)
Returns a random integer from the geometric distribution with parameter p, that is,...
SimTime uniform(cRNG *rng, SimTime a, SimTime b)
SimTime version of uniform(cRNG*,double,double), for convenience.
Definition: distrib.h:56
SimTime exponential(cRNG *rng, SimTime mean)
SimTime version of exponential(cRNG*,double), for convenience.
Definition: distrib.h:70
double lognormal(cRNG *rng, double m, double w)
Returns a random variate from the lognormal distribution with "scale" parameter m and "shape" paramet...
Definition: distrib.h:251
SimTime normal(cRNG *rng, SimTime mean, SimTime stddev)
SimTime version of normal(cRNG*,double,double), for convenience.
Definition: distrib.h:85
int bernoulli(cRNG *rng, double p)
Returns the result of a Bernoulli trial with probability p, that is, 1 with probability p and 0 with ...
Definition: distrib.h:324
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
SIM_API int negbinomial(cRNG *rng, int n, double p)
Returns a random integer from the negative binomial distribution with parameters n and p,...
SIM_API double triang(cRNG *rng, double a, double b, double c)
Returns a random variate from the triangular distribution with parameters a <= b <= c.
SIM_API int poisson(cRNG *rng, double lambda)
Returns a random integer from the Poisson distribution with parameter lambda, that is,...
SIM_API int intuniform(cRNG *rng, int a, int b)
Returns a random integer with uniform distribution in the range [a,b], inclusive. (Note that the func...
Abstract interface for random number generator classes.
Definition: crng.h:48
SIM_API double erlang_k(cRNG *rng, unsigned int k, double mean)
Returns a random variate from the Erlang distribution with k phases and mean mean.
uint32_t intrand(cRNG *rng, uint32_t r)
Produces a random integer in the range [0,r) using the RNG given with its index.
Definition: distrib.h:30
SIM_API int intuniformexcl(cRNG *rng, int a, int b)
Returns a random integer with uniform distribution over [a,b), that is, from [a,b-1].
SIM_API double pareto_shifted(cRNG *rng, double a, double b, double c)
Returns a random variate from the shifted generalized Pareto distribution.
double dbl() const
Definition: simtime.h:346
SIM_API double student_t(cRNG *rng, unsigned int i)
Returns a random variate from the student-t distribution with i degrees of freedom....
virtual double doubleRand()=0
SIM_API double beta(cRNG *rng, double alpha1, double alpha2)
Returns a random variate from the beta distribution with parameters alpha1, alpha2.
double dblrand(cRNG *rng)
Produces a random double in the range [0,1) using the RNG given with its index.
Definition: distrib.h:35
SIM_API double weibull(cRNG *rng, double a, double b)
Returns a random variate from the Weibull distribution with parameters a, b > 0, where a is the "scal...
SIM_API int binomial(cRNG *rng, int n, double p)
Returns a random integer from the binomial distribution with parameters n and p, that is,...