Random Number Generation¶
|
API
|
Topics | |
| Utility functions | |
| Utility functions. | |
| Continuous Distributions | |
| Random variate generators for continuous distributions. | |
| Discrete Distributions | |
| Random variate generators for discrete distributions. | |
Classes | |
| class | cRandom |
| Abstract interface for random variate generator classes. More... | |
| class | cRNG |
| Abstract interface for random number generator classes. More... | |
Description
Draw random values from various distributions.
Distributions
The simulation library provides support for generating random variates from various continuous and discrete distributions: uniform, exponential, normal, truncated normal, gamma, beta, Erlang, Weibull, Bernoulli, binomial, geometric, Poisson, and more.
Generators come in two flavors: as plain functions (taking an RNG and the parameters of the distribution as arguments), and as classes that subclass cRandom and encapsulate both the RNG and the parameters of the distribution.
Random number generators
OMNeT++ provides several random number generators (streams) and several random number generator algorithms (default is cMersenneTwister). RNGs can be configured in omnetpp.ini. RNGs are made available via the cRNG interface, and the cModule::getRNG() method. All functions returning random variates, etc. internally call cModule::getRNG() and cRNG::intRand(), cRNG::doubleRand().
- Note
- The documentation of individual functions may refer to the following publications as [LawKelton] or [Banks]:
- [LawKelton] Simulation Modeling and Analysis, A.M. Law and W.D. Kelton, 3rd ed., McGraw Hill, 2000
- [Banks] Handbook of Simulation, J. Banks, Wiley, 1998
Generated on for API by