roadrunner
2.6.0
Fast simulator for SBML models
|
Define and collect ways to generate random values and values from random distributions. More...
#include <Random.h>
Public Member Functions | |
Random (class ModelGeneratorContext &ctx) | |
creates a new Random object and adds the distrib as global mappings to the execution engine. | |
Random (const Random &other) | |
copy constructor, copy the distributions but reset the RNG to what is specified by the config. | |
Random & | operator= (const Random &rhs) |
assignment operator, copies the fields from the other object, but does not re-intialize them. | |
Random () | |
default ctor, this obviously does not add any mappings to a ModelGeneratorContext. More... | |
double | operator() () |
return a normalized random number between 0 and 1 using the RNG engine. | |
int | getMaxTries () const |
Returns the maximum number of tries to find a value inside a truncated range. | |
void | setMaxTries (int maxTries) |
Sets the maximum number of tries to find a value inside a truncated range. | |
double | min () |
min random number. More... | |
double | max () |
max random number. More... | |
void | setRandomSeed (int64_t) |
Try to hide the RNG, so we can use different RNGs in the future. More... | |
int64_t | getRandomSeed () |
Try to hide the RNG so we can used different RNGs in the future. More... | |
Public Attributes | |
cxx11_ns::mt19937 | engine |
RNG engine. | |
Define and collect ways to generate random values and values from random distributions.
Of particular use when encountering MathML defined by the 'Distributions' SBML L3 package.
rrllvm::Random::Random | ( | ) |
default ctor, this obviously does not add any mappings to a ModelGeneratorContext.
This would be used when a Random is created by itself, to use the attached RNG engine.
int64_t rrllvm::Random::getRandomSeed | ( | ) |
Try to hide the RNG so we can used different RNGs in the future.
get the seed used by the RNG.
|
inline |
max random number.
MSVC looks at this, but gcc stdlib assumes normalized dist.
|
inline |
min random number.
MSVC looks at this, but gcc stdlib assumes normalized dist.
void rrllvm::Random::setRandomSeed | ( | int64_t | val | ) |
Try to hide the RNG, so we can use different RNGs in the future.
set the seed used by the random number generator. This will by definition reset the RNG.