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_trials() const |
| Settings & | num_trials(int n)<br>Sets the number of trials for Monte Carlo simulations. |
| 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 | 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. |
| 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. |
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_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 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 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 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.
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 2025-11-11 at 16:51:08 +0000
