mbdlyb.functional.base ====================== .. py:module:: mbdlyb.functional.base .. autoapi-nested-parse:: Base classes for functional analysis models. This module defines the core node types and dependency relations for functional analysis in model-based diagnosis systems. It includes: - FunctionalNode: Base class for all functional model nodes - OperatingMode: Represents system operating modes - Function: Represents system functions - Hardware: Represents hardware components - DirectObservable: Represents directly observable phenomena - ObservedError: Represents observed error codes - DiagnosticTest: Represents diagnostic tests - DiagnosticTestResult: Represents diagnostic test results - Cluster: Container for a functional model network - FunctionalDependency: Base class for dependency relations - Various relation types: RealizesRelation, RequiredForRelation, AffectsRelation, etc. - ClusterReasonerView: Reasoner view for functional clusters The module integrates with multiple reasoning engines (Bayesian networks, Tensor networks, Markov networks) to support probabilistic fault diagnosis and failure analysis. Classes ------- .. autoapisummary:: mbdlyb.functional.base.AffectsRelation mbdlyb.functional.base.Cluster mbdlyb.functional.base.ClusterReasonerView mbdlyb.functional.base.CommunicatesThroughRelation mbdlyb.functional.base.DiagnosticTest mbdlyb.functional.base.DiagnosticTestResult mbdlyb.functional.base.DirectObservable mbdlyb.functional.base.Function mbdlyb.functional.base.FunctionalDependency mbdlyb.functional.base.FunctionalNode mbdlyb.functional.base.Hardware mbdlyb.functional.base.IndicatedByRelation mbdlyb.functional.base.ObservableNode mbdlyb.functional.base.ObservedByRelation mbdlyb.functional.base.ObservedError mbdlyb.functional.base.OperatingMode mbdlyb.functional.base.RealizesRelation mbdlyb.functional.base.ReportsErrorRelation mbdlyb.functional.base.RequiredForRelation mbdlyb.functional.base.ResultsInRelation mbdlyb.functional.base.SelectOperatingModeRelation mbdlyb.functional.base.SubfunctionOfRelation mbdlyb.functional.base.YieldsErrorRelation Module Contents --------------- .. py:class:: AffectsRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating that hardware degradation affects function operation. :ivar _label: 'affects' :vartype _label: str :ivar source: The affected hardware. :vartype source: Hardware :ivar target: The function affected. :vartype target: Function .. py:attribute:: source :type: Hardware .. py:attribute:: target :type: Function .. py:class:: Cluster(name: str, cluster: Optional[Cluster] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BayesNet`, :py:obj:`mbdlyb.formalisms.tensornet.TensorNet`, :py:obj:`mbdlyb.formalisms.markovnet.MarkovNet`, :py:obj:`mbdlyb.MBDNet` Container for a functional model network. A cluster is a directed acyclic graph (DAG) containing functional nodes (functions, hardware, observables, etc.) and dependency relations. Clusters support multiple reasoning engines (Bayesian, Tensor, Markov networks) and operating mode management. :ivar elements: Named elements in this cluster. :vartype elements: dict[str, Union[FunctionalNode, Cluster]] :ivar _opmsets: Mapping from operating mode sets to their nodes. :vartype _opmsets: dict[OpmSet, MBDNode] :ivar relations: All dependency relations in the cluster. :vartype relations: list[FunctionalDependency] .. py:method:: add_element(element: mbdlyb.MBDElement) Add an element to this cluster. If the element is an OperatingMode, registers it in the operating mode set mapping. :param element: Element to add to the cluster. :type element: MBDElement .. py:method:: create_reasoner_view() -> mbdlyb.MBDNetReasonerView Create a reasoner view for this cluster. :returns: A ClusterReasonerView instance. :rtype: MBDNetReasonerView .. py:method:: filter_operating_modes(operating_modes: list[str]) -> tuple[set[mbdlyb.MBDNode], set[FunctionalDependency]] Filter the model to only include active operating modes. Removes nodes and relations that are disabled by the selected operating modes in a 5-step process: 1. Remove disabled dependency relations 2. Remove test-result nodes with removed indicated-by/yields-error relations 3. Remove function nodes with removed subfunction relations 4. Remove isolated nodes without any relations 5. Remove diagnostic tests without results :param operating_modes: List of operating mode names that are active. :type operating_modes: list[str] :returns: Removed nodes and relations. :rtype: tuple[set[MBDNode], set[FunctionalDependency]] .. py:method:: get_all_opm_nodes() -> dict[mbdlyb.functional.operating_mode.OpmSet, mbdlyb.MBDNode] Get all operating mode nodes in this cluster. :returns: Mapping from OpmSet to OperatingMode node. :rtype: dict[OpmSet, MBDNode] .. py:method:: get_opm_node(fqn: mbdlyb.fqn.FQN) -> Optional[mbdlyb.MBDNode] Get an operating mode node by its fully qualified name. :param fqn: Fully qualified name of the operating mode node. :type fqn: FQN :returns: The operating mode node, or None if not found. :rtype: Optional[MBDNode] .. py:method:: get_opm_node_from_set(opm_set: mbdlyb.functional.operating_mode.OpmSet) -> Optional[mbdlyb.MBDNode] Get the operating mode node for a specific OpmSet. :param opm_set: The operating mode set. :type opm_set: OpmSet :returns: The operating mode node, or None if not found. :rtype: Optional[MBDNode] .. py:method:: propagate_operating_modes(verbose=False) Propagate operating mode constraints throughout the model. Infers operating modes on dependency relations through four propagation steps: 1. Propagate between function nodes via required-for and subfunction relations 2. Propagate from functions to hardware via realizes and affects relations 3. Propagate from yields-error to reports-error relations 4. Propagate from indicated-by to results-in relations :param verbose: If True, print inferred operating modes. Defaults to False. :type verbose: bool .. py:attribute:: elements :type: dict[str, Union[FunctionalNode, Cluster]] .. py:attribute:: relations :type: list[FunctionalDependency] .. py:class:: ClusterReasonerView(net: Cluster) Bases: :py:obj:`mbdlyb.MBDNetReasonerView` Specialized reasoner view for functional clusters. Performs model transformations to make functional clusters suitable for probabilistic reasoning, including cycle elimination, functional decomposition handling, and error reporting unfolding. :ivar net: The cluster being reasoned over. :vartype net: Cluster :ivar _dropped_functional_decomposition_functions: Functions removed during decomposition cleaning. :vartype _dropped_functional_decomposition_functions: list[Function] :ivar _dropped_functional_decomposition_relations: Relations removed during decomposition cleaning. :vartype _dropped_functional_decomposition_relations: list[SubfunctionOfRelation] :ivar _cycles: Detected cycles in function dependencies. :vartype _cycles: list[list[Function]] :ivar _cycle_functions: Cycle placeholders. :vartype _cycle_functions: list[Optional[Function]] :ivar _cycle_relations: Cycle relation placeholders. :vartype _cycle_relations: list[Optional[RequiredForRelation]] :ivar _duplicated_reporting_functions: Duplicated reporting functions. :vartype _duplicated_reporting_functions: dict[Function, set[Function]] :ivar _duplicated_reporting_chains: Duplicated chains. :vartype _duplicated_reporting_chains: dict[RequiredForRelation, set[RequiredForRelation]] :ivar _duplicated_reporting_dependencies: Duplicated dependencies. :vartype _duplicated_reporting_dependencies: dict[FunctionalDependency, set[FunctionalDependency]] .. py:attribute:: net :type: Cluster .. py:class:: CommunicatesThroughRelation(source: mbdlyb.MBDNode, target: mbdlyb.MBDNode, error_codes: Optional[list[ObservedError]] = None, weight: float = 1.0, net: Optional[Cluster] = None) Bases: :py:obj:`FunctionalDependency` Relation representing inter-function communication carrying error information. Represents error propagation through communication between functions. :ivar _label: 'communicates_through' :vartype _label: str :ivar _error_codes: Error codes propagating through communication. :vartype _error_codes: list[ObservedError] :ivar source: The communicating function. :vartype source: Function :ivar target: The function receiving communication. :vartype target: Function .. py:method:: create() Create this relation and register error codes. Adds this relation to the observation paths of its error codes. .. py:method:: remove() Remove this relation and unregister error codes. Removes this relation from the observation paths of its error codes. .. py:property:: error_codes :type: list[ObservedError] Get the error codes propagating through this communication. :returns: Error codes carried by this communication. :rtype: list[ObservedError] .. py:property:: label :type: str Get label with associated error codes. :returns: Label including error code list. :rtype: str .. py:attribute:: source :type: Function .. py:attribute:: target :type: Function .. py:class:: DiagnosticTest(name: str, fixed_cost: dict[str, float], preconditions: dict[str, bool], cluster: Cluster) Bases: :py:obj:`FunctionalNode` Represents a diagnostic test that can be performed on the system. Diagnostic tests are actions taken to evaluate the state of functions and hardware. They have fixed costs and preconditions required before execution. :ivar fixed_cost: Fixed costs by type (e.g., 'time', 'money'). :vartype fixed_cost: dict[str, float] :ivar preconditions: Conditions required for test execution. :vartype preconditions: dict[str, bool] .. py:method:: get_fixed_cost(cost_type: Optional[str] = None) -> float Get the fixed cost of performing this diagnostic test. If cost_type is specified, returns only that cost type. Otherwise returns the sum of all cost types. :param cost_type: Specific cost type to retrieve. Defaults to None. :type cost_type: Optional[str] :returns: The fixed cost value or sum of costs. :rtype: float .. py:attribute:: fixed_cost :type: dict[str, float] .. py:attribute:: preconditions :type: dict[str, bool] .. py:property:: test_results :type: list[DiagnosticTestResult] Get all results produced by this diagnostic test. :returns: Test result nodes related via ResultsInRelation. :rtype: list[DiagnosticTestResult] .. py:class:: DiagnosticTestResult(name: str, states: list[str], fp_rate: float, fn_rate: float, cluster: Cluster) Bases: :py:obj:`ObservableNode` Represents the result or output of a diagnostic test. Test results are observations that show whether a diagnostic test passed or failed. They are produced by DiagnosticTest nodes. .. py:property:: test :type: DiagnosticTest Get the diagnostic test that produces this result. :returns: The test node related via ResultsInRelation. :rtype: DiagnosticTest .. py:class:: DirectObservable(name: str, states: list[str], fp_rate: float, fn_rate: float, cluster: Cluster) Bases: :py:obj:`ObservableNode` Represents a directly observable phenomenon. Direct observables are measurements or observations that directly indicate the state of system components. .. py:class:: Function(name: str, states: list[str], cluster: Cluster) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BayesAutoSplitNode`, :py:obj:`mbdlyb.formalisms.tensornet.TensorAutoSplitNode`, :py:obj:`mbdlyb.formalisms.markovnet.MarkovAutoSplitNode`, :py:obj:`FunctionalNode` Represents a function in the system model. Functions are the core elements of functional models, representing capabilities or behaviors that the system can perform. Functions can have subfunctions (functional decomposition) and can realize hardware components. :ivar DEFAULT_STATES: Default states ['Ok', 'NOk']. :vartype DEFAULT_STATES: list[str] :ivar _split_preserve_classes: Classes to preserve during splitting (OperatingMode). :vartype _split_preserve_classes: list :ivar false_positive_weight: Weight for false positive errors. :vartype false_positive_weight: float .. py:method:: superfunction_chain(as_fqn: bool = False) -> list[list[Union[Function, mbdlyb.fqn.FQN]]] Get all chains of superfunctions up to root functions. :param as_fqn: If True, return FQN objects instead of Function objects. Defaults to False. :type as_fqn: bool :returns: Chains of superfunctions, one per direct superfunction. :rtype: list[list[Union[Function, FQN]]] .. py:method:: valid_parent_relation(relation: mbdlyb.MBDDependency) -> bool Validate if a dependency relation is valid for this function. :param relation: The dependency relation to validate. :type relation: MBDDependency :returns: True if relation is a FunctionalDependency or a normalized numerical node relation. :rtype: bool .. py:attribute:: DEFAULT_STATES :value: ['Ok', 'NOk'] .. py:attribute:: false_positive_weight :type: float :value: 0.0 .. py:property:: has_subfunctions :type: bool Check if this function has subfunctions. :returns: True if this function has any subfunction_of relations. :rtype: bool .. py:property:: has_superfunctions :type: bool Check if this function has superfunctions. :returns: True if this function is a subfunction of other functions. :rtype: bool .. py:property:: subfunctions :type: list[Function] Get all subfunctions of this function. :returns: List of functions this function depends on. :rtype: list[Function] .. py:property:: superfunctions :type: list[Function] Get all superfunctions of this function. :returns: List of functions that depend on this function. :rtype: list[Function] .. py:class:: FunctionalDependency(source: mbdlyb.MBDNode, target: mbdlyb.MBDNode, weight: float = 1.0, net: Optional[Cluster] = None, operating_modes: Optional[mbdlyb.functional.operating_mode.OpmLogic] = None) Bases: :py:obj:`mbdlyb.MBDDependency` Base class for dependency relations in functional models. Represents dependencies between functional nodes with optional operating mode constraints and weights. Supports both explicit and inferred operating modes. :ivar weight: Strength or probability weight of the dependency. :vartype weight: float :ivar _operating_modes: Explicitly specified operating mode constraints. :vartype _operating_modes: OpmLogic :ivar _inferred_opm: Inferred operating mode constraints. :vartype _inferred_opm: Optional[OpmLogic] .. py:method:: set_inferred_operating_modes(operating_modes: mbdlyb.functional.operating_mode.OpmLogic) Set the inferred operating mode constraints. :param operating_modes: The inferred operating mode constraints. :type operating_modes: OpmLogic .. py:property:: inferred_operating_modes :type: mbdlyb.functional.operating_mode.OpmLogic Get the inferred operating mode constraints. :returns: Inferred operating mode logic expression. :rtype: OpmLogic .. py:property:: label :type: str Get the label for this dependency. Includes explicit or inferred operating mode constraints if present. :returns: Label string, optionally with operating mode constraints. :rtype: str .. py:property:: operating_modes :type: mbdlyb.functional.operating_mode.OpmLogic Get the explicit operating mode constraints. :returns: Operating mode logic expression. :rtype: OpmLogic .. py:attribute:: weight :type: float :value: 1.0 .. py:class:: FunctionalNode(name: str, states: list[T], net: MBDNet) Bases: :py:obj:`mbdlyb.MBDNode` Base class for all nodes in functional models. Functional nodes are the basic building blocks of functional models and represent various aspects of a system such as functions, hardware, observables, and tests. All functional nodes support operating modes. :ivar DEFAULT_STATES: Default state values for this node type. :vartype DEFAULT_STATES: list[str] :ivar _EQ_MAP: Mapping from node class names to equivalent/ok states. :vartype _EQ_MAP: dict :ivar _operating_modes: The operating modes applicable to this node. :vartype _operating_modes: OpmSet :ivar parent_relations: Incoming dependency relations. :vartype parent_relations: set[FunctionalDependency] :ivar child_relations: Outgoing dependency relations. :vartype child_relations: set[FunctionalDependency] .. py:method:: set_operating_modes(operating_modes: mbdlyb.functional.operating_mode.OpmSet) Set the operating modes for this node. :param operating_modes: Operating modes to assign to this node. :type operating_modes: OpmSet .. py:attribute:: DEFAULT_STATES :type: list[str] :value: [] .. py:attribute:: child_relations :type: set[FunctionalDependency] .. py:property:: operating_modes :type: mbdlyb.functional.operating_mode.OpmSet Get the operating modes for this node. :returns: Set of operating modes. :rtype: OpmSet .. py:attribute:: parent_relations :type: set[FunctionalDependency] .. py:class:: Hardware(name: str, fault_rates: dict[str, float], cluster: Cluster) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BayesNode`, :py:obj:`mbdlyb.formalisms.tensornet.TensorNode`, :py:obj:`mbdlyb.formalisms.markovnet.MarkovNode`, :py:obj:`FunctionalNode` Represents a hardware component in the system model. Hardware components have failure modes with associated fault rates. They can realize one or more functions in the system. :ivar DEFAULT_STATES: Default states with 'Healthy' as the only state. :vartype DEFAULT_STATES: list[str] :ivar fault_rates: Mapping from fault state names to fault rates. :vartype fault_rates: dict[str, float] .. py:attribute:: DEFAULT_STATES :value: ['Healthy'] .. py:attribute:: fault_rates :type: dict[str, float] .. py:property:: is_elementary :type: bool Check if this hardware is elementary (has no subfunctions). :returns: True if this hardware realizes only functions without subfunctions. :rtype: bool .. py:class:: IndicatedByRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating that a test result indicates node state. :ivar _label: 'indicated_by' :vartype _label: str :ivar source: The indicated component. :vartype source: Union[Hardware, Function] :ivar target: The test result indicating state. :vartype target: DiagnosticTestResult .. py:attribute:: source :type: Union[Hardware, Function] .. py:attribute:: target :type: DiagnosticTestResult .. py:class:: ObservableNode(name: str, states: list[str], fp_rate: float, fn_rate: float, cluster: Cluster) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BayesNode`, :py:obj:`mbdlyb.formalisms.tensornet.TensorNode`, :py:obj:`mbdlyb.formalisms.markovnet.MarkovNode`, :py:obj:`FunctionalNode` Base class for observable nodes in functional models. Observable nodes represent phenomena that can be observed or measured to assess the state of functions and hardware. They have false positive and false negative rates. :ivar DEFAULT_STATES: Default states ['Ok', 'NOk']. :vartype DEFAULT_STATES: list[str] :ivar fp_rate: False positive rate (observing failure when healthy). :vartype fp_rate: float :ivar fn_rate: False negative rate (not observing failure when faulty). :vartype fn_rate: float .. py:attribute:: DEFAULT_STATES :value: ['Ok', 'NOk'] .. py:attribute:: fn_rate :type: float :value: 0.0 .. py:attribute:: fp_rate :type: float :value: 0.0 .. py:class:: ObservedByRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating observation of a node state. :ivar _label: 'observed_by' :vartype _label: str :ivar source: The observed component. :vartype source: Union[Hardware, Function] :ivar target: The observable indicating its state. :vartype target: DirectObservable .. py:attribute:: source :type: Union[Hardware, Function] .. py:attribute:: target :type: DirectObservable .. py:class:: ObservedError(name: str, states: list[str], fp_rate: float, fn_rate: float, error_code: str, cluster: Cluster) Bases: :py:obj:`DirectObservable` Represents an observed error code or failure indication. Observed errors are error codes or indicators that show when functions have failed. They have an associated error code identifier and can be observed through various observation paths (required-for and communicates-through relations). :ivar DEFAULT_STATES: Default states ['Absent', 'Present']. :vartype DEFAULT_STATES: list[str] :ivar error_code: Unique identifier for this error code. :vartype error_code: str :ivar observation_path: Relations through which this error can be observed. :vartype observation_path: set .. py:attribute:: DEFAULT_STATES :value: ['Absent', 'Present'] .. py:property:: enabling_functions :type: list[Function] Get functions that must be Ok to enable error reporting. :returns: Functions related via ReportsErrorRelation. :rtype: list[Function] .. py:attribute:: error_code :type: str .. py:attribute:: observation_path :type: set[Union[RequiredForRelation, CommunicatesThroughRelation]] .. py:property:: observed_function :type: Function Get the function that yields this error. :returns: The function related via YieldsErrorRelation. :rtype: Function .. py:class:: OperatingMode(name: str, operating_modes: list[str], cluster: Cluster) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BayesNode`, :py:obj:`mbdlyb.formalisms.tensornet.TensorNode`, :py:obj:`mbdlyb.formalisms.markovnet.MarkovNode`, :py:obj:`FunctionalNode` Represents an operating mode of a system. Operating modes define different states or configurations in which a system can operate. Each mode represents a mutually exclusive set of possible values. :ivar opm_set: The set of operating mode values. :vartype opm_set: OpmSet .. py:attribute:: opm_set :type: mbdlyb.functional.operating_mode.OpmSet .. py:class:: RealizesRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating that a hardware component realizes a function. :ivar _label: 'realizes' :vartype _label: str :ivar source: The hardware component. :vartype source: Hardware :ivar target: The function realized. :vartype target: Function .. py:attribute:: source :type: Hardware .. py:attribute:: target :type: Function .. py:class:: ReportsErrorRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating that a function enables error reporting. :ivar _label: 'reports_error' :vartype _label: str :ivar source: The enabling function. :vartype source: Function :ivar target: The error code being reported. :vartype target: ObservedError .. py:attribute:: source :type: Function .. py:attribute:: target :type: ObservedError .. py:class:: RequiredForRelation(source: mbdlyb.MBDNode, target: mbdlyb.MBDNode, operating_modes: Optional[mbdlyb.functional.operating_mode.OpmLogic] = None, error_codes: Optional[list[ObservedError]] = None, weight: float = 1.0, net: Optional[Cluster] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating functional dependency between two functions. Represents that one function must work for another to work. Can track error codes that propagate through this dependency. :ivar _label: 'required_for' :vartype _label: str :ivar source: The required function. :vartype source: Function :ivar target: The dependent function. :vartype target: Function :ivar error_codes: Error codes propagating through this relation. :vartype error_codes: list[ObservedError] .. py:method:: create() Create this relation and register error codes. Adds this relation to the observation paths of its error codes. .. py:method:: remove() Remove this relation and unregister error codes. Removes this relation from the observation paths of its error codes. .. py:attribute:: error_codes :type: list[ObservedError] .. py:property:: label :type: str Get label with associated error codes. :returns: Label including error code indicators. :rtype: str .. py:attribute:: source :type: Function .. py:attribute:: target :type: Function .. py:class:: ResultsInRelation(source: mbdlyb.MBDNode, target: mbdlyb.MBDNode, weight: float = 1.0, net: Optional[Cluster] = None, operating_modes: Optional[mbdlyb.functional.operating_mode.OpmLogic] = None) Bases: :py:obj:`FunctionalDependency` Relation indicating that a diagnostic test produces a result. :ivar _label: 'results_in' :vartype _label: str :ivar source: The test. :vartype source: DiagnosticTest :ivar target: The result. :vartype target: DiagnosticTestResult .. py:attribute:: source :type: DiagnosticTest .. py:attribute:: target :type: DiagnosticTestResult .. py:class:: SelectOperatingModeRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating that a function operates in a specific operating mode. :ivar _label: 'select' :vartype _label: str :ivar source: The operating mode. :vartype source: OperatingMode :ivar target: The function operating in this mode. :vartype target: Function .. py:attribute:: source :type: OperatingMode .. py:attribute:: target :type: Function .. py:class:: SubfunctionOfRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation representing functional decomposition hierarchy. :ivar _label: 'subfunction_of' :vartype _label: str :ivar source: The subfunction. :vartype source: Function :ivar target: The superfunction. :vartype target: Function .. py:attribute:: source :type: Function .. py:attribute:: target :type: Function .. py:class:: YieldsErrorRelation(source: MBDNode, target: MBDNode, net: Optional[MBDNet] = None) Bases: :py:obj:`mbdlyb.formalisms.bayesnet.BNDependency`, :py:obj:`mbdlyb.formalisms.tensornet.TNDependency`, :py:obj:`mbdlyb.formalisms.markovnet.MNDependency`, :py:obj:`FunctionalDependency` Relation indicating that a function failure yields an error code. :ivar _label: 'yields_errors' :vartype _label: str :ivar source: The function that yields the error. :vartype source: Function :ivar target: The error code yielded. :vartype target: ObservedError .. py:attribute:: source :type: Function .. py:attribute:: target :type: ObservedError