roadrunner  2.6.0
Fast simulator for SBML models
Public Member Functions | Public Attributes | List of all members
rrllvm::Random Class Reference

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.
 
Randomoperator= (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Random()

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.

Member Function Documentation

◆ getRandomSeed()

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.

◆ max()

double rrllvm::Random::max ( )
inline

max random number.

MSVC looks at this, but gcc stdlib assumes normalized dist.

◆ min()

double rrllvm::Random::min ( )
inline

min random number.

MSVC looks at this, but gcc stdlib assumes normalized dist.

◆ setRandomSeed()

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.


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