Skip to content

scram::core::Settings

Builder for analysis settings. More...

#include <settings.h>

Public Functions

Name
Settings &approximation(Approximation value)<br>Sets the approximation for quantitative analysis.
Settings &approximation(std::string_view value)
Algorithmalgorithm() const
Settings &algorithm(Algorithm value)<br>Sets the algorithm for Qualitative analysis.
Settings &algorithm(std::string_view value)<br>Provides a convenient wrapper for algorithm setting from a string.
Approximationapproximation() const
boolprime_implicants() const
Settings &prime_implicants(bool flag)<br>Sets a flag to calculate prime implicants instead of minimal cut sets.
intlimit_order() const
Settings &limit_order(int order)<br>Sets the limit order for products.
doublecut_off() const
Settings &cut_off(double prob)<br>Sets the cut-off probability for products to be considered for analysis.
intnum_trials() const
Settings &num_trials(int n)<br>Sets the number of trials for Monte Carlo simulations.
intnum_quantiles() const
Settings &num_quantiles(int n)<br>Sets the number of quantiles for distributions.
intnum_bins() const
Settings &num_bins(int n)<br>Sets the number of bins for histograms.
intseed() const
Settings &seed(int s)<br>Sets the seed for the pseudo-random number generator.
doublemission_time() const
Settings &mission_time(double time)<br>Sets the system mission time.
doubletime_step() const
Settings &time_step(double time)<br>Sets the time step for probability analyses.
boolprobability_analysis() const
Settings &probability_analysis(bool flag)<br>Sets the flag for probability analysis.
boolsafety_integrity_levels() const
Settings &safety_integrity_levels(bool flag)<br>Sets the flag for calculation of the SIL metrics.
boolimportance_analysis() const
Settings &importance_analysis(bool flag)<br>Sets the flag for importance analysis.
booluncertainty_analysis() const
Settings &uncertainty_analysis(bool flag)<br>Sets the flag for uncertainty analysis.
boolccf_analysis() const
Settings &ccf_analysis(bool flag)<br>Sets the flag for CCF analysis.

Public Attributes

Name
boolpreprocessor <br>Stop analysis after preprocessor.
boolprint <br>Print analysis results in a terminal friendly way.

Detailed Description

cpp
class scram::core::Settings;

Builder for analysis settings.

Warning:

  • Some settings with defaults and constraints may have side-effects on other settings.
  • The order of building the settings matters.

Analysis facilities are guaranteed not to throw or fail with an instance of this class.

Public Functions Documentation

function approximation

cpp
Settings & approximation(
    Approximation value
)

Sets the approximation for quantitative analysis.

Parameters:

  • value Approximation kind to be applied.

Exceptions:

  • SettingsError The approximation is not recognized or inappropriate for analysis.

Return: Reference to this object.

function approximation

cpp
Settings & approximation(
    std::string_view value
)

function algorithm

cpp
inline Algorithm algorithm() const

Return: The Qualitative analysis algorithm.

function algorithm

cpp
Settings & algorithm(
    Algorithm value
)

Sets the algorithm for Qualitative analysis.

Parameters:

  • value The algorithm kind.

Return: Reference to this object.

Appropriate defaults are given to other settings relevant to the algorithm.

MOCUS and ZBDD based analyses run with the Rare-Event approximation by default. Whereas, BDD based analyses run with exact quantitative analysis.

function algorithm

cpp
Settings & algorithm(
    std::string_view value
)

Provides a convenient wrapper for algorithm setting from a string.

Parameters:

  • value The string representation of the algorithm.

Exceptions:

Return: Reference to this object.

function approximation

cpp
inline Approximation approximation() const

Return: The quantitative analysis approximation.

function prime_implicants

cpp
inline bool prime_implicants() const

Return: true if prime implicants are to be calculated instead of minimal cut sets.

function prime_implicants

cpp
Settings & prime_implicants(
    bool flag
)

Sets a flag to calculate prime implicants instead of minimal cut sets.

Parameters:

  • flag True for the request.

Exceptions:

Return: Reference to this object.

Prime implicants can only be calculated with BDD-based algorithms.

The request for prime implicants cancels the request for inapplicable quantitative analysis approximations.

function limit_order

cpp
inline int limit_order() const

Return: The limit on the size of products.

function limit_order

cpp
Settings & limit_order(
    int order
)

Sets the limit order for products.

Parameters:

  • order A non-negative number for the limit order.

Exceptions:

Return: Reference to this object.

function cut_off

cpp
inline double cut_off() const

Return: The minimum required probability for products.

function cut_off

cpp
Settings & cut_off(
    double prob
)

Sets the cut-off probability for products to be considered for analysis.

Parameters:

  • prob The minimum probability for products.

Exceptions:

Return: Reference to this object.

function num_trials

cpp
inline int num_trials() const

Return: The number of trials for Monte-Carlo simulations.

function num_trials

cpp
Settings & num_trials(
    int n
)

Sets the number of trials for Monte Carlo simulations.

Parameters:

  • n A natural number for the number of trials.

Exceptions:

Return: Reference to this object.

function num_quantiles

cpp
inline int num_quantiles() const

Return: The number of quantiles for distributions.

function num_quantiles

cpp
Settings & num_quantiles(
    int n
)

Sets the number of quantiles for distributions.

Parameters:

  • n A natural number for the number of quantiles.

Exceptions:

Return: Reference to this object.

function num_bins

cpp
inline int num_bins() const

Return: The number of bins for histograms.

function num_bins

cpp
Settings & num_bins(
    int n
)

Sets the number of bins for histograms.

Parameters:

  • n A natural number for the number of bins.

Exceptions:

Return: Reference to this object.

function seed

cpp
inline int seed() const

Return: The seed of the pseudo-random number generator.

function seed

cpp
Settings & seed(
    int s
)

Sets the seed for the pseudo-random number generator.

Parameters:

  • s A positive number.

Exceptions:

Return: Reference to this object.

function mission_time

cpp
inline double mission_time() const

Return: The length time of the system under risk.

function mission_time

cpp
Settings & mission_time(
    double time
)

Sets the system mission time.

Parameters:

  • time A positive number in hours by default.

Exceptions:

Return: Reference to this object.

function time_step

cpp
inline double time_step() const

Return: The time step in hours for probability analyses. 0 if the time step doesn't apply.

function time_step

cpp
Settings & time_step(
    double time
)

Sets the time step for probability analyses.

Parameters:

  • time The time in hours to partition the mission time.

Exceptions:

  • SettingsError The time value is negative.
  • SettingsError The time step is being disabled (value 0) while the SIL metrics are requested.

Return: Reference to this object.

0 value signifies that the time step doesn't apply.

function probability_analysis

cpp
inline bool probability_analysis() const

Return: true if probability analysis is requested.

function probability_analysis

cpp
inline Settings & probability_analysis(
    bool flag
)

Sets the flag for probability analysis.

Parameters:

  • flag True or false for turning on or off the analysis.

Return: Reference to this object.

If another analysis requires probability analysis, it won't be possible to turn off probability analysis before the parent analysis.

function safety_integrity_levels

cpp
inline bool safety_integrity_levels() const

Return: true if the SIL metrics are requested.

function safety_integrity_levels

cpp
Settings & safety_integrity_levels(
    bool flag
)

Sets the flag for calculation of the SIL metrics.

Parameters:

  • flag True or false for turning on or off the analysis.

Exceptions:

Return: Reference to this object.

This requires that time-step is set.

function importance_analysis

cpp
inline bool importance_analysis() const

Return: true if importance analysis is requested.

function importance_analysis

cpp
inline Settings & importance_analysis(
    bool flag
)

Sets the flag for importance analysis.

Parameters:

  • flag True or false for turning on or off the analysis.

Return: Reference to this object.

Importance analysis is performed together with probability analysis. Appropriate flags are turned on.

function uncertainty_analysis

cpp
inline bool uncertainty_analysis() const

Return: true if uncertainty analysis is requested.

function uncertainty_analysis

cpp
inline Settings & uncertainty_analysis(
    bool flag
)

Sets the flag for uncertainty analysis.

Parameters:

  • flag True or false for turning on or off the analysis.

Return: Reference to this object.

Uncertainty analysis implies probability analysis, so the probability analysis is turned on implicitly.

function ccf_analysis

cpp
inline bool ccf_analysis() const

Return: true if CCF groups must be incorporated into analysis.

function ccf_analysis

cpp
inline Settings & ccf_analysis(
    bool flag
)

Sets the flag for CCF analysis.

Parameters:

  • flag True or false for turning on or off the analysis.

Return: Reference to this object.

Public Attributes Documentation

variable preprocessor

cpp
bool preprocessor = false;

Stop analysis after preprocessor.

variable print

cpp
bool print = false;

Print analysis results in a terminal friendly way.


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