scram::mef
Namespaces
| Name |
|---|
| scram::mef::cycle |
| scram::mef::detail |
Classes
| Name | |
|---|---|
| class | scram::mef::Alignment <br>Alignment configuration for the whole model per analysis. |
| class | scram::mef::AlphaFactorModel <br>Alpha factor model characterizes failure of exactly k members of the group due to common cause. |
| class | scram::mef::Attribute <br>MEF Element Attributes. |
| class | scram::mef::BasicEvent <br>Representation of a basic event in a fault tree. |
| class | scram::mef::BetaDeviate <br>Beta distribution. |
| class | scram::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. |
| struct | scram::mef::Bifunctor <br>Creates a functor for functions with two arguments. |
| class | scram::mef::Block <br>Compound instructions. |
| class | scram::mef::Branch <br>The branch representation in event trees. |
| class | scram::mef::CcfEvent <br>A basic event that represents a multiple failure of a group of events due to a common cause. |
| class | scram::mef::CcfGroup <br>Abstract base class for all common cause failure models. |
| class | scram::mef::CollectExpression <br>The operation of collecting expressions for event tree sequences. |
| class | scram::mef::CollectFormula <br>The operation of connecting fault tree events into the event tree. |
| class | scram::mef::Component <br>Component is for logical grouping of events, gates, and other components. |
| class | scram::mef::Composite <br>The composition of multiple mef::Containers. |
| class | scram::mef::ConstantExpression <br>Indicates a constant value. |
| class | scram::mef::Container <br>The MEF Container of unique elements. |
| class | scram::mef::ContainerElement <br>Elements in MEF containers. |
| struct | scram::mef::Context <br>The context for test-event expressions. |
| struct | scram::mef::CycleError <br>Unacceptable cycles in model structures. |
| struct | scram::mef::DomainError <br>Invalid domain for values or arguments. |
| struct | scram::mef::DuplicateElementError <br>This error indicates that elements must be unique. |
| class | scram::mef::Element <br>The MEF Element with attributes and a label. |
| class | scram::mef::Event <br>Abstract base class for general fault tree events. |
| class | scram::mef::EventTree <br>Event Tree representation with MEF constructs. |
| class | scram::mef::Exponential <br>Negative exponential distribution with hourly failure rate and time. |
| class | scram::mef::Expression <br>Abstract base class for all sorts of expressions to describe events. |
| class | scram::mef::ExpressionFormula <br>CRTP for Expressions with the same formula to evaluate and sample. |
| class | scram::mef::ExternExpression <br>Expression evaluating an extern function with expression arguments. |
| class | scram::mef::ExternFunction <br>Extern function abstraction to be referenced by expressions. |
| class | scram::mef::ExternFunction< void > <br>Abstract base class for ExternFunction concrete types. |
| class | scram::mef::ExternLibrary <br>The MEF construct to extend expressions with external libraries. |
| class | scram::mef::FaultTree <br>Fault tree representation as a container of gates, basic and house events, and other information. |
| class | scram::mef::Fork <br>Functional event forks. |
| class | scram::mef::Formula <br>Boolean formula with connectives and arguments. |
| class | scram::mef::FunctionalEvent <br>Representation of functional events in event trees. |
| struct | scram::mef::Functor <br>Creates a functor out of function pointer to common cmath functions. |
| class | scram::mef::GammaDeviate <br>Gamma distribution. |
| class | scram::mef::Gate <br>A representation of a gate in a fault tree. |
| class | scram::mef::Glm <br>Exponential with probability of failure on demand, hourly failure rate, hourly repairing rate, and time. |
| class | scram::mef::Histogram <br>Histogram distribution. |
| class | scram::mef::HouseEvent <br>Representation of a house event in a fault tree. |
| class | scram::mef::Id <br>Mixin class for assigning unique identifiers to elements. |
| class | scram::mef::IfThenElse <br>Conditional application of instructions. |
| class | scram::mef::Initializer <br>This class operates on input files to initialize analysis constructs like models, fault trees, and events. |
| class | scram::mef::InitiatingEvent <br>Event-tree Initiating Event. |
| class | scram::mef::Instruction <br>Instructions and rules for event tree paths. |
| class | scram::mef::InstructionVisitor <br>The base abstract class for instruction visitors. |
| class | scram::mef::Ite <br>If-Then-Else ternary expression. |
| class | scram::mef::Link <br>A link to another event tree in end-states only. |
| class | scram::mef::LognormalDeviate <br>Log-normal distribution. |
| class | scram::mef::Mean <br>The average of argument expression values. |
| class | scram::mef::MglModel <br>Multiple Greek Letters model characterizes failure of sub-groups of the group due to common cause. |
| class | scram::mef::MissionTime <br>The special parameter for system mission time. |
| class | scram::mef::Model <br>This class represents a risk analysis model. |
| class | scram::mef::NamedBranch <br>Named branches that can be referenced and reused. |
| class | scram::mef::NaryExpression <br>n-ary expressions. |
| class | scram::mef::NaryExpression< T, -1 > <br>Multivariate expression. |
| class | scram::mef::NaryExpression< T, 1 > <br>Unary expression. |
| class | scram::mef::NaryExpression< T, 2 > <br>Binary expression. |
| class | scram::mef::NodeMark <br>Mixin class for providing marks for graph nodes. |
| class | scram::mef::NormalDeviate <br>Normal distribution. |
| class | scram::mef::NullVisitor <br>Visits only instructions and ignores non-instructions. |
| class | scram::mef::Parameter <br>This class provides a representation of a variable in basic event description. |
| class | scram::mef::Path <br>Functional-event state paths in event trees. |
| class | scram::mef::PeriodicTest <br>Periodic test with 3 phases: deploy, test, functioning. |
| class | scram::mef::Phase <br>Phases of alignments the models spends its time fraction. |
| class | scram::mef::PhiFactorModel <br>Phi factor model is a simplification, where fractions of k-member group failure is given directly. |
| class | scram::mef::RandomDeviate <br>Abstract base class for all deviate expressions. |
| class | scram::mef::Role <br>Mixin class that manages private or public roles for elements as needed. |
| class | scram::mef::Rule <br>A reusable collection of instructions. |
| class | scram::mef::Sequence <br>Representation of sequences in event trees. |
| class | scram::mef::SetHouseEvent <br>The operation to change house-events. |
| class | scram::mef::Substitution <br>The general representation for Delete Terms, Recovery Rules, and Exchange Events. |
| class | scram::mef::Switch <br>Switch-Case conditional operations. |
| class | scram::mef::TableRange <br>Wraps the element container tables into ranges of plain references to hide the memory smart or raw pointers. |
| class | scram::mef::TestEvent <br>The abstract base class for non-deviate test-event expressions. |
| class | scram::mef::TestFunctionalEvent <br>Upon event-tree walk, tests whether a functional event has occurred. |
| class | scram::mef::TestInitiatingEvent <br>Upon event-tree walk, tests whether an initiating event has occurred. |
| struct | scram::mef::UndefinedElement <br>The error for undefined elements in a model. |
| class | scram::mef::UniformDeviate <br>Uniform distribution. |
| class | scram::mef::Usage <br>Mixin class for providing usage marks for elements. |
| struct | scram::mef::ValidityError <br>Model validity errors. |
| class | scram::mef::Visitable <br>Default visit for instruction type of T. |
| class | scram::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_t | RoleSpecifier { kPublic, kPrivate}<br>Role, access attributes for elements. |
| enum std::uint8_t | Connective { kAnd = 0, kOr, kAtleast, kXor, kNot, kNand, kNor, kNull, kIff, kImply, kCardinality}<br>Logical connectives for formulas. |
| enum std::uint8_t | Units { 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_bounds | IntervalBounds <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::string | GetFullPath(const T * element)<br>Computes the full path of an element. |
| bool | operator==(const Formula::Arg & lhs, const Formula::Arg & rhs)<br>Comparison of formula arguments. |
| void | EnsureProbability(Expression * expression, const char * type ="probability")<br>Ensures that expression can be used for probability ([0, 1]). |
| void | EnsurePositive(Expression * expression, const char * description)<br>Ensures that expression yields positive (> 0) values. |
| void | EnsureNonNegative(Expression * expression, const char * description)<br>Ensures that expression yields non-negative (>= 0) values. |
| void | EnsureWithin(Expression * expression, const Interval & interval, const char * type)<br>Ensures that expression values are within the interval. |
| bool | Contains(const Interval & interval, double value)<br>Returns true if a given interval contains a given value. |
| bool | IsProbability(const Interval & interval)<br>Checks if a given interval is within the probability domain. |
| bool | IsNonNegative(const Interval & interval)<br>Checks if all values in a given interval are non-negative. |
| bool | IsPositive(const Interval & interval)<br>Checks if all values in a given interval are positive. |
| void | Serialize(const Model & model, const std::string & file)<br>Convenience function for serialization into a file. |
| void | Serialize(const Model & model, std::FILE * out)<br>Serializes the model and its data into stream as XML. |
Attributes
| Name | |
|---|---|
| const int | kNumConnectives <br>The number of connectives in the enum. |
| const char *const[] | kConnectiveToString <br>String representations of the connectives. |
| const int | kNumUnits <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
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
using scram::mef::errinfo_container_type = typedef boost::error_info<struct tag_container_type, const char*>;using errinfo_container
using scram::mef::errinfo_container = typedef boost::tuple<errinfo_container_id, errinfo_container_type>;using errinfo_element_id
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
using scram::mef::errinfo_element_type = typedef boost::error_info<struct tag_element_type, const char*>;using errinfo_element
using scram::mef::errinfo_element = typedef boost::tuple<errinfo_element_id, errinfo_element_type>;enum RoleSpecifier
| Enumerator | Value | Description |
|---|---|---|
| kPublic | ||
| kPrivate |
Role, access attributes for elements.
enum Connective
| Enumerator | Value | Description |
|---|---|---|
| kAnd | 0 | |
| kOr | ||
| kAtleast | Combination, K/N, atleast, or Vote gate representation. | |
| kXor | Exclusive OR gate with two inputs only. | |
| kNot | Boolean negation. | |
| kNand | Not AND. | |
| kNor | Not OR. | |
| kNull | Single argument pass-through without logic. | |
| kIff | Equality with two inputs only. | |
| kImply | Implication with two inputs only. | |
| kCardinality | General quantifier of events. |
Logical connectives for formulas.
The ordering is the same as analysis connectives in the PDAG.
enum Units
| Enumerator | Value | Description |
|---|---|---|
| kUnitless | 0 | |
| kBool | ||
| kInt | ||
| kFloat | ||
| kHours | ||
| kInverseHours | ||
| kYears | ||
| kInverseYears | ||
| kFit | ||
| kDemands |
Provides units for parameters.
using ElementTable
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
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
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
using scram::mef::errinfo_attribute = typedef boost::error_info<struct tag_attribute, std::string>;using errinfo_reference
using scram::mef::errinfo_reference = typedef boost::error_info<struct tag_reference, std::string>;The MEF element reference.
using errinfo_base_path
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
using scram::mef::errinfo_cycle = typedef boost::error_info<struct tag_cycle, std::string>;String representation of invalid cycles/loops.
using errinfo_connective
using scram::mef::errinfo_connective = typedef boost::error_info<struct tag_connective, std::string>;Connectives in formulae.
using FormulaPtr
using scram::mef::FormulaPtr = typedef std::unique_ptr<Formula>;Convenience alias.
using Interval
using scram::mef::Interval = typedef boost::icl::continuous_interval<double>;Validation domain interval for expression values.
using IntervalBounds
using scram::mef::IntervalBounds = typedef boost::icl::interval_bounds;left_open, open, right_open, closed bounds.
using Not
using scram::mef::Not = typedef NaryExpression<std::logical_not<>, 1>;Logical negation.
using And
using scram::mef::And = typedef NaryExpression<std::logical_and<>, -1>;Logical conjunction.
using Or
using scram::mef::Or = typedef NaryExpression<std::logical_or<>, -1>;Logical disjunction.
using Eq
using scram::mef::Eq = typedef NaryExpression<std::equal_to<>, 2>;Equality test.
using Df
using scram::mef::Df = typedef NaryExpression<std::not_equal_to<>, 2>;Inequality test.
using Lt
using scram::mef::Lt = typedef NaryExpression<std::less<>, 2>;(<) test.
using Gt
using scram::mef::Gt = typedef NaryExpression<std::greater<>, 2>;(>) test.
using Leq
using scram::mef::Leq = typedef NaryExpression<std::less_equal<>, 2>;(<=) test.
using Geq
using scram::mef::Geq = typedef NaryExpression<std::greater_equal<>, 2>;(>=) test.
using ExternFunctionPtr
using scram::mef::ExternFunctionPtr = typedef std::unique_ptr<ExternFunction<void> >;Base ptr.
using ExternFunctionBase
using scram::mef::ExternFunctionBase = typedef ExternFunction<void>;To help Doxygen.
using FunctorExpression
template <double(*)(double) F>
using scram::mef::FunctorExpression = typedef NaryExpression<Functor<F>, 1>;Expression with a functor wrapping a function.
using BifunctorExpression
template <double(*)(double, double) F>
using scram::mef::BifunctorExpression = typedef NaryExpression<Bifunctor<F>, 2>;Expression with a bifunctor wrapping a function.
using Neg
using scram::mef::Neg = typedef NaryExpression<std::negate<>, 1>;Negation.
using Add
using scram::mef::Add = typedef NaryExpression<std::plus<>, -1>;Sum operation.
using Sub
using scram::mef::Sub = typedef NaryExpression<std::minus<>, -1>;Subtraction from the first.
using Mul
using scram::mef::Mul = typedef NaryExpression<std::multiplies<>, -1>;Product.
using Div
using scram::mef::Div = typedef NaryExpression<std::divides<>, -1>;Division of the first.
using Abs
using scram::mef::Abs = typedef FunctorExpression<&std::abs>;The absolute value.
using Acos
using scram::mef::Acos = typedef FunctorExpression<&std::acos>;Arc cosine.
using Asin
using scram::mef::Asin = typedef FunctorExpression<&std::asin>;Arc sine.
using Atan
using scram::mef::Atan = typedef FunctorExpression<&std::atan>;Arc tangent.
using Cos
using scram::mef::Cos = typedef FunctorExpression<&std::cos>;Cosine.
using Sin
using scram::mef::Sin = typedef FunctorExpression<&std::sin>;Sine.
using Tan
using scram::mef::Tan = typedef FunctorExpression<&std::tan>;Tangent.
using Cosh
using scram::mef::Cosh = typedef FunctorExpression<&std::cosh>;Hyperbolic cosine.
using Sinh
using scram::mef::Sinh = typedef FunctorExpression<&std::sinh>;Hyperbolic sine.
using Tanh
using scram::mef::Tanh = typedef FunctorExpression<&std::tanh>;Hyperbolic tangent.
using Exp
using scram::mef::Exp = typedef FunctorExpression<&std::exp>;using Log
using scram::mef::Log = typedef FunctorExpression<&std::log>;Natural logarithm.
using Log10
using scram::mef::Log10 = typedef FunctorExpression<&std::log10>;Decimal logarithm.
using Mod
using scram::mef::Mod = typedef NaryExpression<std::modulus<int>, 2>;Modulo (%) operation.
using Pow
using scram::mef::Pow = typedef BifunctorExpression<&std::pow>;Base raised to a power.
using Sqrt
using scram::mef::Sqrt = typedef FunctorExpression<&std::sqrt>;Square root.
using Ceil
using scram::mef::Ceil = typedef FunctorExpression<&std::ceil>;Nearest (>=) integer.
using Floor
using scram::mef::Floor = typedef FunctorExpression<&std::floor>;Nearest (<=) integer.
using Min
using scram::mef::Min = typedef NaryExpression<Bifunctor<&std::fmin>, -1>;Minimum value.
using Max
using scram::mef::Max = typedef NaryExpression<Bifunctor<&std::fmax>, -1>;Maximum value.
Functions Documentation
function GetFullPath
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==
inline bool operator==(
const Formula::Arg & lhs,
const Formula::Arg & rhs
)Comparison of formula arguments.
function EnsureProbability
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
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
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
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
inline bool Contains(
const Interval & interval,
double value
)Returns true if a given interval contains a given value.
function IsProbability
inline bool IsProbability(
const Interval & interval
)Checks if a given interval is within the probability domain.
function IsNonNegative
inline bool IsNonNegative(
const Interval & interval
)Checks if all values in a given interval are non-negative.
function IsPositive
inline bool IsPositive(
const Interval & interval
)Checks if all values in a given interval are positive.
function Serialize
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
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
const int kNumConnectives = 11;The number of connectives in the enum.
variable kConnectiveToString
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
const int kNumUnits = 10;The number of elements in the Units enum.
variable kUnitsToString
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
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
