Skip to content

scram::core::FaultTreeAnalysis

Fault tree analysis functionality. More...

#include <fault_tree_analysis.h>

Inherits from scram::core::Analysis, boost::noncopyable

Inherited by scram::core::FaultTreeAnalyzer< Algorithm >

Public Functions

Name
FaultTreeAnalysis(const mef::Gate & root, const Settings & settings, const mef::Model * model =nullptr)<br>Traverses a valid fault tree from the root gate to collect databases of events, gates, and other members of the fault tree.
virtual~FaultTreeAnalysis() =default
const mef::Gate &top_event() const
voidAnalyze()<br>Analyzes the fault tree and performs computations.
const ProductContainer &products() const
boolhas_products() const
std::shared_ptr< Pdag >pdag()
const ProductSummary *last_product_summary() const
booladaptive_mode_used() const
doubleadaptive_target_probability() const
voidinitiating_event_frequency(double frequency)<br>Sets the initiating event frequency to be applied during analysis.

Protected Functions

Name
Pdag *graph() const

Additional inherited members

Public Functions inherited from scram::core::Analysis

Name
Analysis(Settings settings)
virtual~Analysis() =0<br>Abstract class.
const Settings &settings() const
const std::string &warnings() const
doubleanalysis_time() const

Protected Functions inherited from scram::core::Analysis

Name
Settings &settings()
voidAddWarning(std::string msg)<br>Appends a warning message to the analysis warnings.
voidAddAnalysisTime(double time)<br>Adds time to the total analysis time.

Detailed Description

cpp
class scram::core::FaultTreeAnalysis;

Fault tree analysis functionality.

Warning: Run analysis only once. One analysis per FaultTreeAnalysis object.

The analysis must be done on a validated and fully initialized fault trees. After initialization of the analysis, the fault tree under analysis should not change; otherwise, the success of the analysis is not guaranteed, and the results may be invalid. After the requested analysis is done, the fault tree can be changed without restrictions. However, other analyses may rely on unchanged fault tree to use the results of this fault tree analysis.

To conduct a new analysis on the changed fault tree, a new FaultTreeAnalysis object must be created. In general, rerunning the same analysis twice will mess up the analysis and corrupt the previous results.

Public Functions Documentation

function FaultTreeAnalysis

cpp
FaultTreeAnalysis(
    const mef::Gate & root,
    const Settings & settings,
    const mef::Model * model =nullptr
)

Traverses a valid fault tree from the root gate to collect databases of events, gates, and other members of the fault tree.

Parameters:

  • root The top event of the fault tree to analyze.
  • settings Analysis settings for all calculations.
  • model The Model containing substitutions if any.

Note: It is assumed that analysis is done only once.

Warning: If the fault tree structure is changed, this analysis does not incorporate the changed structure. Moreover, the analysis results may get corrupted.

The passed fault tree must be pre-validated without cycles, and its events must be fully initialized.

function ~FaultTreeAnalysis

cpp
virtual ~FaultTreeAnalysis() =default

function top_event

cpp
inline const mef::Gate & top_event() const

Return: The top gate that is passed to the analysis.

function Analyze

cpp
void Analyze()

Analyzes the fault tree and performs computations.

Note: This function is expected to be called only once.

Warning:

  • If the original fault tree is invalid, this function will not throw or indicate any errors. The behavior is undefined for invalid fault trees.
  • If the fault tree structure has changed since the construction of the analysis, the analysis will be invalid or fail.

This function must be called only after initializing the fault tree with or without its probabilities.

function products

cpp
inline const ProductContainer & products() const

Return: A collection of Boolean products as the analysis results.

Precondition: The analysis is done.

function has_products

cpp
inline bool has_products() const

Return: true if products were generated and stored.

function pdag

cpp
inline std::shared_ptr< Pdag > pdag()

function last_product_summary

cpp
inline const ProductSummary * last_product_summary() const

function adaptive_mode_used

cpp
inline bool adaptive_mode_used() const

function adaptive_target_probability

cpp
inline double adaptive_target_probability() const

function initiating_event_frequency

cpp
inline void initiating_event_frequency(
    double frequency
)

Sets the initiating event frequency to be applied during analysis.

Parameters:

  • frequency The initiating event frequency (default 1.0).

Precondition: Must be called before Analyze().

Protected Functions Documentation

function graph

cpp
inline Pdag * graph() const

Return: Pointer to the PDAG representing the fault tree.


Updated on 2026-01-09 at 21:59:11 +0000