Skip to content

scram::mef::BasicEvent

Representation of a basic event in a fault tree.

#include <event.h>

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

Inherited by scram::mef::CcfEvent

Public Functions

Name
virtual~BasicEvent() =default
boolHasExpression() const
voidexpression(Expression * expression)<br>Sets the expression of this basic event.
Expression &expression() const
doublep() const
voidValidate() const<br>Validates the probability expressions for the primary event.
boolHasCcf() const<br>Indicates if this basic event has been set to be in a CCF group.
const Gate &ccf_gate() const
voidccf_gate(std::unique_ptr< Gate > gate)<br>Sets the common cause failure group gate that can represent this basic event in analysis with common cause information.

Public Attributes

Name
constexpr const char *kTypeString <br>In errors.

Additional inherited members

Public Functions inherited from scram::mef::Event

Name
virtual~Event() =0<br>Abstract class.
Id(std::string name, std::string base_path ="", RoleSpecifier role =RoleSpecifier::kPublic)<br>Constructs an element with an original name.

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)
Id(std::string name, std::string base_path ="", RoleSpecifier role =RoleSpecifier::kPublic)<br>Constructs an element with an original name.
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 Functions inherited from scram::mef::Usage

Name
boolusage() const
voidusage(bool usage)

Protected Functions inherited from scram::mef::Usage

Name
~Usage() =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

Public Functions Documentation

function ~BasicEvent

cpp
virtual ~BasicEvent() =default

function HasExpression

cpp
inline bool HasExpression() const

Return: true if the probability expression is set.

function expression

cpp
inline void expression(
    Expression * expression
)

Sets the expression of this basic event.

Parameters:

  • expression The expression to describe this event. nullptr to remove unset the expression.

function expression

cpp
inline Expression & expression() const

Return: The previously set expression for analysis purposes.

Precondition: The expression has been set.

function p

cpp
inline double p() const

Return: The mean probability of this basic event.

Note: The user of this function should make sure that the returned value is acceptable for calculations.

Precondition: The expression has been set.

function Validate

cpp
void Validate() const

Validates the probability expressions for the primary event.

Exceptions:

  • DomainError The expression for the basic event is invalid.

Precondition: The probability expression is set.

function HasCcf

cpp
inline bool HasCcf() const

Indicates if this basic event has been set to be in a CCF group.

Return: true if in a CCF group.

function ccf_gate

cpp
inline const Gate & ccf_gate() const

Return: CCF group gate representing this basic event.

function ccf_gate

cpp
inline void ccf_gate(
    std::unique_ptr< Gate > gate
)

Sets the common cause failure group gate that can represent this basic event in analysis with common cause information.

Parameters:

  • gate CCF group gate.

This information is expected to be provided by CCF group application.

Public Attributes Documentation

variable kTypeString

cpp
static constexpr const char * kTypeString = "basic event";

In errors.


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