Skip to content

scram::mef::RandomDeviate

Abstract base class for all deviate expressions. More...

#include <random_deviate.h>

Inherits from scram::mef::Expression, boost::noncopyable

Inherited by scram::mef::BetaDeviate, scram::mef::GammaDeviate, scram::mef::Histogram, scram::mef::LognormalDeviate, scram::mef::NormalDeviate, scram::mef::UniformDeviate

Public Functions

Name
virtual boolIsDeviate() override<br>Determines if the value of the expression contains deviate expressions.
Expression(std::vector< Expression * > args ={})<br>Constructor for use by derived classes to register their arguments.
voidseed(unsigned seed)<br>Sets the seed of the underlying random number generator.

Protected Functions

Name
std::mt19937 &rng()

Additional inherited members

Public Functions inherited from scram::mef::Expression

Name
virtual~Expression() =default
const std::vector< Expression * > &args() const
virtual voidValidate() const<br>Validates the expression.
virtual doublevalue() =0
virtual Intervalinterval()
doubleSample()
voidReset()<br>This routine resets the sampling to get new values.

Protected Functions inherited from scram::mef::Expression

Name
voidAddArg(Expression * arg)<br>Registers an additional argument expression.

Detailed Description

cpp
class scram::mef::RandomDeviate;

Abstract base class for all deviate expressions.

Note: Only single RNG is embedded for convenience. All the distributions share this RNG. This is not suitable for parallelized simulations!!!

These expressions provide quantification for uncertainty and sensitivity.

Public Functions Documentation

function IsDeviate

cpp
inline virtual bool IsDeviate() override

Determines if the value of the expression contains deviate expressions.

Return:

  • true if the expression's value deviates from its mean.
  • false if the expression's value does not need sampling.

Warning: Improper registration of arguments may yield silent failure.

Reimplements: scram::mef::Expression::IsDeviate

The default logic is to check arguments with uncertainties for sampling. Derived expression classes must decide if they don't have arguments, or if they are random deviates.

function Expression

cpp
explicit Expression(
    std::vector< Expression * > args ={}
)

Constructor for use by derived classes to register their arguments.

Parameters:

  • args Arguments of this expression.

function seed

cpp
static inline void seed(
    unsigned seed
)

Sets the seed of the underlying random number generator.

Parameters:

  • seed The seed for RNGs.

Note: This is static! Used by all the deriving deviates.

Protected Functions Documentation

function rng

cpp
inline std::mt19937 & rng()

Return: RNG to be used by derived classes.


Updated on 2025-11-11 at 16:51:08 +0000