BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
BPMNOS::RandomDistributionFactory Class Reference

Factory for random distribution functions in LIMEX expressions. More...

Detailed Description

Registers random functions (uniform, normal, etc.) with a LIMEX handle. Before evaluating expressions containing random functions, setCurrentRng() must be called to provide the RNG context.

Definition at line 31 of file RandomDistributionFactory.h.

#include <RandomDistributionFactory.h>

Public Member Functions

void registerFunctions (LIMEX::Handle< double > &handle)
 Register all random distribution functions with the given LIMEX handle.
 
void setCurrentRng (std::mt19937 *rng)
 Set the current RNG to use for expression evaluation.
 
std::mt19937 * getCurrentRng () const
 Get the current RNG.
 

Member Function Documentation

◆ getCurrentRng()

std::mt19937 * BPMNOS::RandomDistributionFactory::getCurrentRng ( ) const
inline

Definition at line 61 of file RandomDistributionFactory.h.

◆ registerFunctions()

void RandomDistributionFactory::registerFunctions ( LIMEX::Handle< double > & handle)

Supported functions:

  • uniform(min, max): Uniform real distribution
  • uniform_int(min, max): Uniform integer distribution
  • normal(mean, stddev): Normal/Gaussian distribution
  • exponential(rate): Exponential distribution
  • poisson(mean): Poisson distribution
  • bernoulli(p): Bernoulli (0 or 1)
  • binomial(n, p): Binomial distribution
  • gamma(shape, scale): Gamma distribution
  • lognormal(logscale, shape): Log-normal distribution
  • geometric(p): Geometric distribution

Definition at line 89 of file RandomDistributionFactory.cpp.

◆ setCurrentRng()

void BPMNOS::RandomDistributionFactory::setCurrentRng ( std::mt19937 * rng)
inline

Must be called before evaluating any expression containing random functions.

Parameters
rngPointer to the RNG to use, or nullptr to clear.

Definition at line 56 of file RandomDistributionFactory.h.


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