Skip to content

scram::mef::CcfGroup ​

Abstract base class for all common cause failure models.

#include <ccf_group.h>

Inherits from scram::mef::Id, scram::mef::Element, scram::mef::Role, scram::mef::ContainerElement, boost::noncopyable

Inherited by scram::mef::AlphaFactorModel, scram::mef::BetaFactorModel, scram::mef::MglModel, scram::mef::PhiFactorModel

Protected Types ​

Name
using std::vector< std::pair< int, Expression * > >ExpressionMap <br>Mapping expressions and their application levels.

Public Functions ​

Name
virtual~CcfGroup() =default
const std::vector< BasicEvent * > &members() const
voidAddMember(BasicEvent * basic_event)<br>Adds a basic event into this CCF group.
voidAddDistribution(Expression * distr)<br>Adds the distribution that describes the probability of basic events in this CCF group.
voidAddFactor(Expression * factor, std::optional< int > level ={})<br>Adds a CCF factor for the specified model.
voidValidate() const<br>Validates the setup for the CCF model and group.
voidApplyModel()<br>Processes the given factors and members to create common cause failure probabilities and new events that can replace the members in a fault tree.
Id(std::string name, std::string base_path ="", RoleSpecifier role =RoleSpecifier::kPublic)<br>Constructs an element with an original name.

Protected Functions ​

Name
template <class T ,typename... Ts> <br>Expression *Register(Ts &&... args)<br>Registers a new expression for ownership by the group.
template <class T > <br>Expression *Register(std::initializer_list< Expression * > args)
Expression *distribution() const
const ExpressionMap &factors() const

Public Attributes ​

Name
constexpr const char *kTypeString <br>Type string for error messages.

Additional inherited members ​

Public Functions inherited from scram::mef::Id

Name
const std::string &unique_name(const Element & element)<br>Produces unique name for the model element within the same type.
const std::string &unique_name(const Id & element)
const std::string &id() const
std::string_viewid_view() const
std::string_viewfull_path() const
voidid(std::string name)<br>Resets the element ID.

Protected Functions inherited from scram::mef::Id

Name
~Id() =default

Public Types inherited from scram::mef::Element

Name
using ext::linear_set< Attribute, AttributeKey >AttributeMap <br>Unique attribute map keyed with the attribute names.

Public Functions inherited from scram::mef::Element

Name
Element(std::string name)<br>Constructs an element with an original name.
const std::string &name() const
std::string_viewname_view() const
const std::string &label() const
voidlabel(std::string label)<br>Sets the element label.
const AttributeMap &attributes() const
voidAddAttribute(Attribute attr)<br>Adds an attribute to the attribute map of this element.
voidSetAttribute(Attribute attr)<br>Sets an attribute to the attribute map.
const Attribute *GetAttribute(std::string_view name) const
std::optional< Attribute >RemoveAttribute(std::string_view name)<br>Removes an attribute of this element.

Protected Functions inherited from scram::mef::Element

Name
~Element() =default
voidname(std::string name)<br>Resets the element name.

Public Functions inherited from scram::mef::Role

Name
Role(RoleSpecifier role =RoleSpecifier::kPublic, std::string base_path ="")<br>Sets the role of an element upon creation.
RoleSpecifierrole() const
const std::string &base_path() const

Protected Functions inherited from scram::mef::Role

Name
~Role() =default

Protected Functions inherited from scram::mef::ContainerElement

Name
const Element *container() const

Friends inherited from scram::mef::ContainerElement

Name
classContainer

Protected Types Documentation ​

using ExpressionMap ​

cpp
using scram::mef::CcfGroup::ExpressionMap =  std::vector<std::pair<int, Expression*> >;

Mapping expressions and their application levels.

Public Functions Documentation ​

function ~CcfGroup ​

cpp
virtual ~CcfGroup() =default

function members ​

cpp
inline const std::vector< BasicEvent * > & members() const

Return: Members of the CCF group with original names as keys.

function AddMember ​

cpp
void AddMember(
    BasicEvent * basic_event
)

Adds a basic event into this CCF group.

Parameters:

  • basic_event A member basic event.

Exceptions:

  • DuplicateElementError The basic event is already in the group.
  • LogicError The probability distribution or factors for this CCF group are already defined. No more members are accepted.

This function asserts that each basic event has unique string id.

function AddDistribution ​

cpp
void AddDistribution(
    Expression * distr
)

Adds the distribution that describes the probability of basic events in this CCF group.

Parameters:

  • distr The probability distribution of this group.

Exceptions:

All basic events should be added as members before defining their probabilities. No more basic events can be added after this function.

function AddFactor ​

cpp
void AddFactor(
    Expression * factor,
    std::optional< int > level ={}
)

Adds a CCF factor for the specified model.

Parameters:

  • factor A factor for the CCF model.
  • level The level of the passed factor.

Exceptions:

All basic events should be added as members before defining the CCF factors. No more basic events can be added after this function.

function Validate ​

cpp
void Validate() const

Validates the setup for the CCF model and group.

Exceptions:

Checks if the provided distribution is between 0 and 1.

This check must be performed before validating basic events that are members of this CCF group to give more precise error messages.

function ApplyModel ​

cpp
void ApplyModel()

Processes the given factors and members to create common cause failure probabilities and new events that can replace the members in a fault tree.

Precondition: The CCF is validated.

function Id ​

cpp
explicit Id(
    std::string name,
    std::string base_path ="",
    RoleSpecifier role =RoleSpecifier::kPublic
)

Constructs an element with an original name.

Parameters:

  • name The local identifier name.
  • role A role specifier of the element.
  • base_path The series of containers to get this event.

Exceptions:

The name is expected to conform to identifier requirements described in the MEF documentation and additions.

Sets the role of an element upon creation.

The base reference path must be formatted according to the MEF documentation and additions.

Mangles the element name into a unique id. Private elements get their full path as their ids, while public elements retain their name as ids.

Protected Functions Documentation ​

function Register ​

cpp
template <class T ,
typename... Ts>
inline Expression * Register(
    Ts &&... args
)

Registers a new expression for ownership by the group.

function Register ​

cpp
template <class T >
inline Expression * Register(
    std::initializer_list< Expression * > args
)

function distribution ​

cpp
inline Expression * distribution() const

Return: The probability distribution of the events.

function factors ​

cpp
inline const ExpressionMap & factors() const

Return: CCF factors of the model.

Public Attributes Documentation ​

variable kTypeString ​

cpp
static constexpr const char * kTypeString = "CCF group";

Type string for error messages.


Updated on 2025-12-19 at 21:56:46 +0000