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) |
| Algorithm | algorithm() 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. |
| Approximation | approximation() const |
| bool | prime_implicants() const |
| Settings & | prime_implicants(bool flag)<br>Sets a flag to calculate prime implicants instead of minimal cut sets. |
| int | limit_order() const |
| Settings & | limit_order(int order)<br>Sets the limit order for products. |
| double | cut_off() const |
| Settings & | cut_off(double prob)<br>Sets the cut-off probability for products to be considered for analysis. |
| int | num_quantiles() const |
| Settings & | num_quantiles(int n)<br>Sets the number of quantiles for distributions. |
| int | num_bins() const |
| Settings & | num_bins(int n)<br>Sets the number of bins for histograms. |
| int | num_trials() const |
| Settings & | num_trials(int n)<br>Sets the number of trials for Monte Carlo simulations. |
| int | seed() const |
| Settings & | seed(int s)<br>Sets the seed for the pseudo-random number generator. |
| double | mission_time() const |
| Settings & | mission_time(double time)<br>Sets the system mission time. |
| double | time_step() const |
| Settings & | time_step(double time)<br>Sets the time step for probability analyses. |
| bool | probability_analysis() const |
| Settings & | probability_analysis(bool flag)<br>Sets the flag for probability analysis. |
| Settings & | skip_products(bool flag)<br>Sets the flag for skipping products calculation. |
| bool | skip_products() const |
| bool | bit_pack_cut_sets() const |
| Settings & | bit_pack_cut_sets(bool flag)<br>Enables/disables packed bit-vector cut set serialization. |
| bool | requires_products() const |
| bool | safety_integrity_levels() const |
| Settings & | safety_integrity_levels(bool flag)<br>Sets the flag for calculation of the SIL metrics. |
| bool | importance_analysis() const |
| Settings & | importance_analysis(bool flag)<br>Sets the flag for importance analysis. |
| bool | uncertainty_analysis() const |
| Settings & | uncertainty_analysis(bool flag)<br>Sets the flag for uncertainty analysis. |
| bool | ccf_analysis() const |
| Settings & | ccf_analysis(bool flag)<br>Sets the flag for CCF analysis. |
| bool | adaptive() const |
| Settings & | adaptive(bool flag)<br>Sets the flag for adaptive quantification. |
| bool | expand_atleast_gates() const |
| bool | expand_xor_gates() const |
| bool | keep_null_gates() const |
| int | compilation_level() const |
| Settings & | expand_xor_gates(const bool on) |
| Settings & | expand_atleast_gates(const bool on) |
| Settings & | keep_null_gates(const bool on) |
| Settings & | compilation_level(const int level) |
| const std::vector< std::string > & | input_files() const |
| Settings & | input_files(const std::vector< std::string > & files)<br>Sets/overwrites the list of MEF input files (primarily called by CLI glue code). |
| mef::Model * | model() const |
| Settings & | model(mef::Model * model)<br>Sets/overwrites the list of MEF input files (primarily called by CLI glue code). |
Public Attributes
| Name | |
|---|---|
| bool | preprocessor <br>Stop analysis after preprocessor. |
| bool | print <br>Print analysis results in a terminal friendly way. |
Detailed Description
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
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
Settings & approximation(
std::string_view value
)function algorithm
inline Algorithm algorithm() constReturn: The Qualitative analysis algorithm.
function algorithm
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
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:
- SettingsError The algorithm is not recognized.
Return: Reference to this object.
function approximation
inline Approximation approximation() constReturn: The quantitative analysis approximation.
function prime_implicants
inline bool prime_implicants() constReturn: true if prime implicants are to be calculated instead of minimal cut sets.
function prime_implicants
Settings & prime_implicants(
bool flag
)Sets a flag to calculate prime implicants instead of minimal cut sets.
Parameters:
- flag True for the request.
Exceptions:
- SettingsError The request is not relevant to the algorithm.
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
inline int limit_order() constReturn: The limit on the size of products.
function limit_order
Settings & limit_order(
int order
)Sets the limit order for products.
Parameters:
- order A non-negative number for the limit order.
Exceptions:
- SettingsError The number is less than 0.
Return: Reference to this object.
function cut_off
inline double cut_off() constReturn: The minimum required probability for products.
function cut_off
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:
- SettingsError The probability is not in the [0, 1] range.
Return: Reference to this object.
function num_quantiles
inline int num_quantiles() constReturn: The number of quantiles for distributions.
function num_quantiles
Settings & num_quantiles(
int n
)Sets the number of quantiles for distributions.
Parameters:
- n A natural number for the number of quantiles.
Exceptions:
- SettingsError The number is less than 1.
Return: Reference to this object.
function num_bins
inline int num_bins() constReturn: The number of bins for histograms.
function num_bins
Settings & num_bins(
int n
)Sets the number of bins for histograms.
Parameters:
- n A natural number for the number of bins.
Exceptions:
- SettingsError The number is less than 1.
Return: Reference to this object.
function num_trials
inline int num_trials() constReturn: The number of trials for Monte Carlo simulations.
function num_trials
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:
- SettingsError The number is less than 1.
Return: Reference to this object.
function seed
inline int seed() constReturn: The seed of the pseudo-random number generator.
function seed
Settings & seed(
int s
)Sets the seed for the pseudo-random number generator.
Parameters:
- s A positive number.
Exceptions:
- SettingsError The number is negative.
Return: Reference to this object.
function mission_time
inline double mission_time() constReturn: The length time of the system under risk.
function mission_time
Settings & mission_time(
double time
)Sets the system mission time.
Parameters:
- time A positive number in hours by default.
Exceptions:
- SettingsError The time value is negative.
Return: Reference to this object.
function time_step
inline double time_step() constReturn: The time step in hours for probability analyses. 0 if the time step doesn't apply.
function time_step
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
inline bool probability_analysis() constReturn: true if probability analysis is requested.
function probability_analysis
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 skip_products
inline Settings & skip_products(
bool flag
)Sets the flag for skipping products calculation.
Parameters:
- flag True or false for turning on or off the products calculation.
Return: Reference to this object.
function skip_products
inline bool skip_products() constReturn: true if the products calculation will be skipped.
function bit_pack_cut_sets
inline bool bit_pack_cut_sets() constReturn: true if cut sets should be serialized as packed bit-vectors.
function bit_pack_cut_sets
inline Settings & bit_pack_cut_sets(
bool flag
)Enables/disables packed bit-vector cut set serialization.
Note: Default is false to preserve existing XML output.
function requires_products
inline bool requires_products() constReturn: true if qualitative product enumeration is required for the requested analyses under current settings.
This is primarily used to skip cut set enumeration for BDD when only probability with exact calculation (no approximation) is requested. In all other cases (ZBDD/MOCUS algorithms, approximations, prime implicants, importance/uncertainty, or debug printing), products are required.
function safety_integrity_levels
inline bool safety_integrity_levels() constReturn: true if the SIL metrics are requested.
function safety_integrity_levels
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:
- SettingsError The flag is True, but no time-step is set.
Return: Reference to this object.
This requires that time-step is set.
function importance_analysis
inline bool importance_analysis() constReturn: true if importance analysis is requested.
function importance_analysis
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
inline bool uncertainty_analysis() constReturn: true if uncertainty analysis is requested.
function uncertainty_analysis
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
inline bool ccf_analysis() constReturn: true if CCF groups must be incorporated into analysis.
function ccf_analysis
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.
function adaptive
inline bool adaptive() constReturn: true if adaptive quantification is requested.
function adaptive
inline Settings & adaptive(
bool flag
)Sets the flag for adaptive quantification.
Parameters:
- flag True or false for turning on or off adaptive mode.
Return: Reference to this object.
When enabled, products are sorted by probability and accumulated until the exact BDD probability is reached.
function expand_atleast_gates
inline bool expand_atleast_gates() constfunction expand_xor_gates
inline bool expand_xor_gates() constfunction keep_null_gates
inline bool keep_null_gates() constfunction compilation_level
inline int compilation_level() constfunction expand_xor_gates
inline Settings & expand_xor_gates(
const bool on
)function expand_atleast_gates
inline Settings & expand_atleast_gates(
const bool on
)function keep_null_gates
inline Settings & keep_null_gates(
const bool on
)function compilation_level
inline Settings & compilation_level(
const int level
)function input_files
inline const std::vector< std::string > & input_files() constReturn: the list of MEF input files provided for the analysis (can be empty).
function input_files
inline Settings & input_files(
const std::vector< std::string > & files
)Sets/overwrites the list of MEF input files (primarily called by CLI glue code).
A reference is not kept – a copy of the vector is stored inside the Settings instance.
function model
inline mef::Model * model() constReturn: an optional shared pointer to the MEF model
function model
inline Settings & model(
mef::Model * model
)Sets/overwrites the list of MEF input files (primarily called by CLI glue code).
A reference is not kept – a copy of the vector is stored inside the Settings instance.
Public Attributes Documentation
variable preprocessor
bool preprocessor = false;Stop analysis after preprocessor.
variable print
bool print = false;Print analysis results in a terminal friendly way.
Updated on 2026-01-09 at 21:59:12 +0000
