Skip to content

scram::mef

Namespaces

Name
scram::mef::cycle
scram::mef::detail

Classes

Name
classscram::mef::Alignment <br>Alignment configuration for the whole model per analysis.
classscram::mef::AlphaFactorModel <br>Alpha factor model characterizes failure of exactly k members of the group due to common cause.
classscram::mef::Attribute <br>MEF Element Attributes.
classscram::mef::BasicEvent <br>Representation of a basic event in a fault tree.
classscram::mef::BetaDeviate <br>Beta distribution.
classscram::mef::BetaFactorModel <br>Common cause failure model that assumes, if common cause failure occurs, then all components or members fail simultaneously or within short time.
structscram::mef::Bifunctor <br>Creates a functor for functions with two arguments.
classscram::mef::Block <br>Compound instructions.
classscram::mef::Branch <br>The branch representation in event trees.
classscram::mef::CcfEvent <br>A basic event that represents a multiple failure of a group of events due to a common cause.
classscram::mef::CcfGroup <br>Abstract base class for all common cause failure models.
classscram::mef::CollectExpression <br>The operation of collecting expressions for event tree sequences.
classscram::mef::CollectFormula <br>The operation of connecting fault tree events into the event tree.
classscram::mef::Component <br>Component is for logical grouping of events, gates, and other components.
classscram::mef::Composite <br>The composition of multiple mef::Containers.
classscram::mef::ConstantExpression <br>Indicates a constant value.
classscram::mef::Container <br>The MEF Container of unique elements.
classscram::mef::ContainerElement <br>Elements in MEF containers.
structscram::mef::Context <br>The context for test-event expressions.
structscram::mef::CycleError <br>Unacceptable cycles in model structures.
structscram::mef::DomainError <br>Invalid domain for values or arguments.
structscram::mef::DuplicateElementError <br>This error indicates that elements must be unique.
classscram::mef::Element <br>The MEF Element with attributes and a label.
classscram::mef::Event <br>Abstract base class for general fault tree events.
classscram::mef::EventTree <br>Event Tree representation with MEF constructs.
classscram::mef::Exponential <br>Negative exponential distribution with hourly failure rate and time.
classscram::mef::Expression <br>Abstract base class for all sorts of expressions to describe events.
classscram::mef::ExpressionFormula <br>CRTP for Expressions with the same formula to evaluate and sample.
classscram::mef::ExternExpression <br>Expression evaluating an extern function with expression arguments.
classscram::mef::ExternFunction <br>Extern function abstraction to be referenced by expressions.
classscram::mef::ExternFunction< void > <br>Abstract base class for ExternFunction concrete types.
classscram::mef::ExternLibrary <br>The MEF construct to extend expressions with external libraries.
classscram::mef::FaultTree <br>Fault tree representation as a container of gates, basic and house events, and other information.
classscram::mef::Fork <br>Functional event forks.
classscram::mef::Formula <br>Boolean formula with connectives and arguments.
classscram::mef::FunctionalEvent <br>Representation of functional events in event trees.
structscram::mef::Functor <br>Creates a functor out of function pointer to common cmath functions.
classscram::mef::GammaDeviate <br>Gamma distribution.
classscram::mef::Gate <br>A representation of a gate in a fault tree.
classscram::mef::Glm <br>Exponential with probability of failure on demand, hourly failure rate, hourly repairing rate, and time.
classscram::mef::Histogram <br>Histogram distribution.
classscram::mef::HouseEvent <br>Representation of a house event in a fault tree.
classscram::mef::Id <br>Mixin class for assigning unique identifiers to elements.
classscram::mef::IfThenElse <br>Conditional application of instructions.
classscram::mef::Initializer <br>This class operates on input files to initialize analysis constructs like models, fault trees, and events.
classscram::mef::InitiatingEvent <br>Event-tree Initiating Event.
classscram::mef::Instruction <br>Instructions and rules for event tree paths.
classscram::mef::InstructionVisitor <br>The base abstract class for instruction visitors.
classscram::mef::Ite <br>If-Then-Else ternary expression.
classscram::mef::Link <br>A link to another event tree in end-states only.
classscram::mef::LognormalDeviate <br>Log-normal distribution.
classscram::mef::Mean <br>The average of argument expression values.
classscram::mef::MglModel <br>Multiple Greek Letters model characterizes failure of sub-groups of the group due to common cause.
classscram::mef::MissionTime <br>The special parameter for system mission time.
classscram::mef::Model <br>This class represents a risk analysis model.
classscram::mef::NamedBranch <br>Named branches that can be referenced and reused.
classscram::mef::NaryExpression <br>n-ary expressions.
classscram::mef::NaryExpression< T, -1 > <br>Multivariate expression.
classscram::mef::NaryExpression< T, 1 > <br>Unary expression.
classscram::mef::NaryExpression< T, 2 > <br>Binary expression.
classscram::mef::NodeMark <br>Mixin class for providing marks for graph nodes.
classscram::mef::NormalDeviate <br>Normal distribution.
classscram::mef::NullVisitor <br>Visits only instructions and ignores non-instructions.
classscram::mef::Parameter <br>This class provides a representation of a variable in basic event description.
classscram::mef::Path <br>Functional-event state paths in event trees.
classscram::mef::PeriodicTest <br>Periodic test with 3 phases: deploy, test, functioning.
classscram::mef::Phase <br>Phases of alignments the models spends its time fraction.
classscram::mef::PhiFactorModel <br>Phi factor model is a simplification, where fractions of k-member group failure is given directly.
classscram::mef::RandomDeviate <br>Abstract base class for all deviate expressions.
classscram::mef::Role <br>Mixin class that manages private or public roles for elements as needed.
classscram::mef::Rule <br>A reusable collection of instructions.
classscram::mef::Sequence <br>Representation of sequences in event trees.
classscram::mef::SetHouseEvent <br>The operation to change house-events.
classscram::mef::Substitution <br>The general representation for Delete Terms, Recovery Rules, and Exchange Events.
classscram::mef::Switch <br>Switch-Case conditional operations.
classscram::mef::TableRange <br>Wraps the element container tables into ranges of plain references to hide the memory smart or raw pointers.
classscram::mef::TestEvent <br>The abstract base class for non-deviate test-event expressions.
classscram::mef::TestFunctionalEvent <br>Upon event-tree walk, tests whether a functional event has occurred.
classscram::mef::TestInitiatingEvent <br>Upon event-tree walk, tests whether an initiating event has occurred.
structscram::mef::UndefinedElement <br>The error for undefined elements in a model.
classscram::mef::UniformDeviate <br>Uniform distribution.
classscram::mef::Usage <br>Mixin class for providing usage marks for elements.
structscram::mef::ValidityError <br>Model validity errors.
classscram::mef::Visitable <br>Default visit for instruction type of T.
classscram::mef::Weibull <br>Weibull distribution with scale, shape, time shift, and time.

Types

Name
using boost::error_info< struct tag_contianer_id, std::string >errinfo_container_id <br>The MEF container element as namespace.
using boost::error_info< struct tag_container_type, const char * >errinfo_container_type
using boost::tuple< errinfo_container_id, errinfo_container_type >errinfo_container
using boost::error_info< struct tag_element_id, std::string >errinfo_element_id <br>The MEF element identifier data in errors.
using boost::error_info< struct tag_element_type, const char * >errinfo_element_type
using boost::tuple< errinfo_element_id, errinfo_element_type >errinfo_element
enum class std::uint8_tRoleSpecifier { kPublic, kPrivate}<br>Role, access attributes for elements.
enum std::uint8_tConnective { kAnd = 0, kOr, kAtleast, kXor, kNot, kNand, kNor, kNull, kIff, kImply, kCardinality}<br>Logical connectives for formulas.
enum std::uint8_tUnits { kUnitless = 0, kBool, kInt, kFloat, kHours, kInverseHours, kYears, kInverseYears, kFit, kDemands}<br>Provides units for parameters.
template <typename T > <br>using boost::multi_index_container< T, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Element, std::string_view, &Element::name_view >, std::hash< std::string_view > > > >ElementTable <br>Table of elements with unique names.
template <typename T > <br>using boost::multi_index_container< T, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Id, std::string_view, &Id::id_view >, std::hash< std::string_view > > > >IdTable <br>Table of elements with unique ids.
template <class T ,class... Ts> <br>using Composite< Container< T, Ts >... >MultiContainer <br>Convenience alias for a homogeneous composite of containers.
using boost::error_info< struct tag_attribute, std::string >errinfo_attribute <br>MEF ElementAttribute.
using boost::error_info< struct tag_reference, std::string >errinfo_reference <br>The MEF element reference.
using boost::error_info< struct tag_base_path, std::string >errinfo_base_path <br>The base path to follow the reference.
using boost::error_info< struct tag_cycle, std::string >errinfo_cycle <br>String representation of invalid cycles/loops.
using boost::error_info< struct tag_connective, std::string >errinfo_connective <br>Connectives in formulae.
using std::unique_ptr< Formula >FormulaPtr <br>Convenience alias.
using boost::icl::continuous_interval< double >Interval <br>Validation domain interval for expression values.
using boost::icl::interval_boundsIntervalBounds <br>left_open, open, right_open, closed bounds.
using NaryExpression< std::logical_not<>, 1 >Not <br>Logical negation.
using NaryExpression< std::logical_and<>, -1 >And <br>Logical conjunction.
using NaryExpression< std::logical_or<>, -1 >Or <br>Logical disjunction.
using NaryExpression< std::equal_to<>, 2 >Eq <br>Equality test.
using NaryExpression< std::not_equal_to<>, 2 >Df <br>Inequality test.
using NaryExpression< std::less<>, 2 >Lt <br>(<) test.
using NaryExpression< std::greater<>, 2 >Gt <br>(>) test.
using NaryExpression< std::less_equal<>, 2 >Leq <br>(<=) test.
using NaryExpression< std::greater_equal<>, 2 >Geq <br>(>=) test.
using std::unique_ptr< ExternFunction< void > >ExternFunctionPtr <br>Base ptr.
using ExternFunction< void >ExternFunctionBase <br>To help Doxygen.
template <double(*)(double) F> <br>using NaryExpression< Functor< F >, 1 >FunctorExpression <br>Expression with a functor wrapping a function.
template <double(*)(double, double) F> <br>using NaryExpression< Bifunctor< F >, 2 >BifunctorExpression <br>Expression with a bifunctor wrapping a function.
using NaryExpression< std::negate<>, 1 >Neg <br>Negation.
using NaryExpression< std::plus<>, -1 >Add <br>Sum operation.
using NaryExpression< std::minus<>, -1 >Sub <br>Subtraction from the first.
using NaryExpression< std::multiplies<>, -1 >Mul <br>Product.
using NaryExpression< std::divides<>, -1 >Div <br>Division of the first.
using FunctorExpression<&std::abs >Abs <br>The absolute value.
using FunctorExpression<&std::acos >Acos <br>Arc cosine.
using FunctorExpression<&std::asin >Asin <br>Arc sine.
using FunctorExpression<&std::atan >Atan <br>Arc tangent.
using FunctorExpression<&std::cos >Cos <br>Cosine.
using FunctorExpression<&std::sin >Sin <br>Sine.
using FunctorExpression<&std::tan >Tan <br>Tangent.
using FunctorExpression<&std::cosh >Cosh <br>Hyperbolic cosine.
using FunctorExpression<&std::sinh >Sinh <br>Hyperbolic sine.
using FunctorExpression<&std::tanh >Tanh <br>Hyperbolic tangent.
using FunctorExpression<&std::exp >Exp <br>Exponential.
using FunctorExpression<&std::log >Log <br>Natural logarithm.
using FunctorExpression<&std::log10 >Log10 <br>Decimal logarithm.
using NaryExpression< std::modulus< int >, 2 >Mod <br>Modulo (%) operation.
using BifunctorExpression<&std::pow >Pow <br>Base raised to a power.
using FunctorExpression<&std::sqrt >Sqrt <br>Square root.
using FunctorExpression<&std::ceil >Ceil <br>Nearest (>=) integer.
using FunctorExpression<&std::floor >Floor <br>Nearest (<=) integer.
using NaryExpression< Bifunctor<&std::fmin >, -1 >Min <br>Minimum value.
using NaryExpression< Bifunctor<&std::fmax >, -1 >Max <br>Maximum value.

Functions

Name
template <typename T > <br>std::stringGetFullPath(const T * element)<br>Computes the full path of an element.
booloperator==(const Formula::Arg & lhs, const Formula::Arg & rhs)<br>Comparison of formula arguments.
voidEnsureProbability(Expression * expression, const char * type ="probability")<br>Ensures that expression can be used for probability ([0, 1]).
voidEnsurePositive(Expression * expression, const char * description)<br>Ensures that expression yields positive (> 0) values.
voidEnsureNonNegative(Expression * expression, const char * description)<br>Ensures that expression yields non-negative (>= 0) values.
voidEnsureWithin(Expression * expression, const Interval & interval, const char * type)<br>Ensures that expression values are within the interval.
boolContains(const Interval & interval, double value)<br>Returns true if a given interval contains a given value.
boolIsProbability(const Interval & interval)<br>Checks if a given interval is within the probability domain.
boolIsNonNegative(const Interval & interval)<br>Checks if all values in a given interval are non-negative.
boolIsPositive(const Interval & interval)<br>Checks if all values in a given interval are positive.
voidSerialize(const Model & model, const std::string & file)<br>Convenience function for serialization into a file.
voidSerialize(const Model & model, std::FILE * out)<br>Serializes the model and its data into stream as XML.

Attributes

Name
const intkNumConnectives <br>The number of connectives in the enum.
const char *const[]kConnectiveToString <br>String representations of the connectives.
const intkNumUnits <br>The number of elements in the Units enum.
const char *const[]kUnitsToString <br>String representations of the Units in the same order as the enum.
const char *const[]kSubstitutionTypeToString <br>String representations of the "traditional" substitution types in the MEF.

Types Documentation

using errinfo_container_id

cpp
using scram::mef::errinfo_container_id = typedef boost::error_info<struct tag_contianer_id, std::string>;

The MEF container element as namespace.

using errinfo_container_type

cpp
using scram::mef::errinfo_container_type = typedef boost::error_info<struct tag_container_type, const char*>;

using errinfo_container

cpp
using scram::mef::errinfo_container = typedef boost::tuple<errinfo_container_id, errinfo_container_type>;

using errinfo_element_id

cpp
using scram::mef::errinfo_element_id = typedef boost::error_info<struct tag_element_id, std::string>;

The MEF element identifier data in errors.

using errinfo_element_type

cpp
using scram::mef::errinfo_element_type = typedef boost::error_info<struct tag_element_type, const char*>;

using errinfo_element

cpp
using scram::mef::errinfo_element = typedef boost::tuple<errinfo_element_id, errinfo_element_type>;

enum RoleSpecifier

EnumeratorValueDescription
kPublic
kPrivate

Role, access attributes for elements.

enum Connective

EnumeratorValueDescription
kAnd0
kOr
kAtleastCombination, K/N, atleast, or Vote gate representation.
kXorExclusive OR gate with two inputs only.
kNotBoolean negation.
kNandNot AND.
kNorNot OR.
kNullSingle argument pass-through without logic.
kIffEquality with two inputs only.
kImplyImplication with two inputs only.
kCardinalityGeneral quantifier of events.

Logical connectives for formulas.

The ordering is the same as analysis connectives in the PDAG.

enum Units

EnumeratorValueDescription
kUnitless0
kBool
kInt
kFloat
kHours
kInverseHours
kYears
kInverseYears
kFit
kDemands

Provides units for parameters.

using ElementTable

cpp
template <typename T >
using scram::mef::ElementTable = typedef boost::multi_index_container< T, boost::multi_index::indexed_by<boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun<Element, std::string_view, &Element::name_view>, std::hash<std::string_view> >> >;

Table of elements with unique names.

Template Parameters:

  • T Value or (smart/raw) pointer type deriving from Element class.

Precondition: The element names are not modified while it is in the container.

using IdTable

cpp
template <typename T >
using scram::mef::IdTable = typedef boost::multi_index_container< T, boost::multi_index::indexed_by<boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun<Id, std::string_view, &Id::id_view>, std::hash<std::string_view> >> >;

Table of elements with unique ids.

Template Parameters:

  • T Value or (smart/raw) pointer type deriving from Id class.

Precondition: The element IDs are not modified while it is in the container.

using MultiContainer

cpp
template <class T ,
class... Ts>
using scram::mef::MultiContainer = typedef Composite<Container<T, Ts>...>;

Convenience alias for a homogeneous composite of containers.

Template Parameters:

  • T The MEF container type for the CRTP.
  • Ts The MEF element types for the containers.

using errinfo_attribute

cpp
using scram::mef::errinfo_attribute = typedef boost::error_info<struct tag_attribute, std::string>;

MEF ElementAttribute.

using errinfo_reference

cpp
using scram::mef::errinfo_reference = typedef boost::error_info<struct tag_reference, std::string>;

The MEF element reference.

using errinfo_base_path

cpp
using scram::mef::errinfo_base_path = typedef boost::error_info<struct tag_base_path, std::string>;

The base path to follow the reference.

using errinfo_cycle

cpp
using scram::mef::errinfo_cycle = typedef boost::error_info<struct tag_cycle, std::string>;

String representation of invalid cycles/loops.

using errinfo_connective

cpp
using scram::mef::errinfo_connective = typedef boost::error_info<struct tag_connective, std::string>;

Connectives in formulae.

using FormulaPtr

cpp
using scram::mef::FormulaPtr = typedef std::unique_ptr<Formula>;

Convenience alias.

using Interval

cpp
using scram::mef::Interval = typedef boost::icl::continuous_interval<double>;

Validation domain interval for expression values.

using IntervalBounds

cpp
using scram::mef::IntervalBounds = typedef boost::icl::interval_bounds;

left_open, open, right_open, closed bounds.

using Not

cpp
using scram::mef::Not = typedef NaryExpression<std::logical_not<>, 1>;

Logical negation.

using And

cpp
using scram::mef::And = typedef NaryExpression<std::logical_and<>, -1>;

Logical conjunction.

using Or

cpp
using scram::mef::Or = typedef NaryExpression<std::logical_or<>, -1>;

Logical disjunction.

using Eq

cpp
using scram::mef::Eq = typedef NaryExpression<std::equal_to<>, 2>;

Equality test.

using Df

cpp
using scram::mef::Df = typedef NaryExpression<std::not_equal_to<>, 2>;

Inequality test.

using Lt

cpp
using scram::mef::Lt = typedef NaryExpression<std::less<>, 2>;

(<) test.

using Gt

cpp
using scram::mef::Gt = typedef NaryExpression<std::greater<>, 2>;

(>) test.

using Leq

cpp
using scram::mef::Leq = typedef NaryExpression<std::less_equal<>, 2>;

(<=) test.

using Geq

cpp
using scram::mef::Geq = typedef NaryExpression<std::greater_equal<>, 2>;

(>=) test.

using ExternFunctionPtr

cpp
using scram::mef::ExternFunctionPtr = typedef std::unique_ptr<ExternFunction<void> >;

Base ptr.

using ExternFunctionBase

cpp
using scram::mef::ExternFunctionBase = typedef ExternFunction<void>;

To help Doxygen.

using FunctorExpression

cpp
template <double(*)(double) F>
using scram::mef::FunctorExpression = typedef NaryExpression<Functor<F>, 1>;

Expression with a functor wrapping a function.

using BifunctorExpression

cpp
template <double(*)(double, double) F>
using scram::mef::BifunctorExpression = typedef NaryExpression<Bifunctor<F>, 2>;

Expression with a bifunctor wrapping a function.

using Neg

cpp
using scram::mef::Neg = typedef NaryExpression<std::negate<>, 1>;

Negation.

using Add

cpp
using scram::mef::Add = typedef NaryExpression<std::plus<>, -1>;

Sum operation.

using Sub

cpp
using scram::mef::Sub = typedef NaryExpression<std::minus<>, -1>;

Subtraction from the first.

using Mul

cpp
using scram::mef::Mul = typedef NaryExpression<std::multiplies<>, -1>;

Product.

using Div

cpp
using scram::mef::Div = typedef NaryExpression<std::divides<>, -1>;

Division of the first.

using Abs

cpp
using scram::mef::Abs = typedef FunctorExpression<&std::abs>;

The absolute value.

using Acos

cpp
using scram::mef::Acos = typedef FunctorExpression<&std::acos>;

Arc cosine.

using Asin

cpp
using scram::mef::Asin = typedef FunctorExpression<&std::asin>;

Arc sine.

using Atan

cpp
using scram::mef::Atan = typedef FunctorExpression<&std::atan>;

Arc tangent.

using Cos

cpp
using scram::mef::Cos = typedef FunctorExpression<&std::cos>;

Cosine.

using Sin

cpp
using scram::mef::Sin = typedef FunctorExpression<&std::sin>;

Sine.

using Tan

cpp
using scram::mef::Tan = typedef FunctorExpression<&std::tan>;

Tangent.

using Cosh

cpp
using scram::mef::Cosh = typedef FunctorExpression<&std::cosh>;

Hyperbolic cosine.

using Sinh

cpp
using scram::mef::Sinh = typedef FunctorExpression<&std::sinh>;

Hyperbolic sine.

using Tanh

cpp
using scram::mef::Tanh = typedef FunctorExpression<&std::tanh>;

Hyperbolic tangent.

using Exp

cpp
using scram::mef::Exp = typedef FunctorExpression<&std::exp>;

Exponential.

using Log

cpp
using scram::mef::Log = typedef FunctorExpression<&std::log>;

Natural logarithm.

using Log10

cpp
using scram::mef::Log10 = typedef FunctorExpression<&std::log10>;

Decimal logarithm.

using Mod

cpp
using scram::mef::Mod = typedef NaryExpression<std::modulus<int>, 2>;

Modulo (%) operation.

using Pow

cpp
using scram::mef::Pow = typedef BifunctorExpression<&std::pow>;

Base raised to a power.

using Sqrt

cpp
using scram::mef::Sqrt = typedef FunctorExpression<&std::sqrt>;

Square root.

using Ceil

cpp
using scram::mef::Ceil = typedef FunctorExpression<&std::ceil>;

Nearest (>=) integer.

using Floor

cpp
using scram::mef::Floor = typedef FunctorExpression<&std::floor>;

Nearest (<=) integer.

using Min

cpp
using scram::mef::Min = typedef NaryExpression<Bifunctor<&std::fmin>, -1>;

Minimum value.

using Max

cpp
using scram::mef::Max = typedef NaryExpression<Bifunctor<&std::fmax>, -1>;

Maximum value.

Functions Documentation

function GetFullPath

cpp
template <typename T >
std::string GetFullPath(
    const T * element
)

Computes the full path of an element.

Parameters:

  • element A valid element with a name and base path.

Template Parameters:

Return: A string representation of the full path.

function operator==

cpp
inline bool operator==(
    const Formula::Arg & lhs,
    const Formula::Arg & rhs
)

Comparison of formula arguments.

function EnsureProbability

cpp
void EnsureProbability(
    Expression * expression,
    const char * type ="probability"
)

Ensures that expression can be used for probability ([0, 1]).

Parameters:

  • expression The expression to be validated.
  • type The type of probability or fraction for error messages.

Exceptions:

  • DomainError The expression is not suited for probability.

function EnsurePositive

cpp
void EnsurePositive(
    Expression * expression,
    const char * description
)

Ensures that expression yields positive (> 0) values.

Parameters:

  • expression The expression to be validated.
  • description The addition information for error messages.

Exceptions:

  • DomainError The expression is not suited for positive values.

function EnsureNonNegative

cpp
void EnsureNonNegative(
    Expression * expression,
    const char * description
)

Ensures that expression yields non-negative (>= 0) values.

Parameters:

  • expression The expression to be validated.
  • description The addition information for error messages.

Exceptions:

  • DomainError The expression is not suited for non-negative values.

function EnsureWithin

cpp
void EnsureWithin(
    Expression * expression,
    const Interval & interval,
    const char * type
)

Ensures that expression values are within the interval.

Parameters:

  • expression The expression to be validated.
  • interval The allowed interval.
  • type The type of expression for error messages.

Exceptions:

  • DomainError The expression is not suited for non-negative values.

function Contains

cpp
inline bool Contains(
    const Interval & interval,
    double value
)

Returns true if a given interval contains a given value.

function IsProbability

cpp
inline bool IsProbability(
    const Interval & interval
)

Checks if a given interval is within the probability domain.

function IsNonNegative

cpp
inline bool IsNonNegative(
    const Interval & interval
)

Checks if all values in a given interval are non-negative.

function IsPositive

cpp
inline bool IsPositive(
    const Interval & interval
)

Checks if all values in a given interval are positive.

function Serialize

cpp
void Serialize(
    const Model & model,
    const std::string & file
)

Convenience function for serialization into a file.

Parameters:

  • model Fully initialized and valid model.
  • file The output destination.

Exceptions:

  • IOError The output file is not accessible, or the write operation has failed.

function Serialize

cpp
void Serialize(
    const Model & model,
    std::FILE * out
)

Serializes the model and its data into stream as XML.

Parameters:

  • model Fully initialized and valid model.
  • out The stream for XML data.

Exceptions:

  • IOError The write operation has failed.

Attributes Documentation

variable kNumConnectives

cpp
const int kNumConnectives = 11;

The number of connectives in the enum.

variable kConnectiveToString

cpp
const char *const[] kConnectiveToString = {"and", "or",    "atleast",    "xor",
                                           "not", "nand",  "nor",        "null",
                                           "iff", "imply", "cardinality"};

String representations of the connectives.

The ordering is the same as the Connective enum.

variable kNumUnits

cpp
const int kNumUnits = 10;

The number of elements in the Units enum.

variable kUnitsToString

cpp
const char *const[] kUnitsToString = {"unitless", "bool",    "int",   "float",
                                      "hours",    "hours-1", "years", "years-1",
                                      "fit",      "demands"};

String representations of the Units in the same order as the enum.

variable kSubstitutionTypeToString

cpp
const char *const[] kSubstitutionTypeToString = {
    "delete-terms", "recovery-rule", "exchange-event"};

String representations of the "traditional" substitution types in the MEF.


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