modeci_mdf.mdf.Graph

class modeci_mdf.mdf.Graph(id: str, nodes: List[Node] = NOTHING, edges: List[Edge] = NOTHING, parameters: Dict[str, Any] | None = None, conditions: ConditionSet | None = None, *, metadata: Dict[str, Any] | None = None)[source]

Bases: MdfBase

A directed graph consisting of :class:`~Node`s (with :class:`~Parameter`s and :class:`~Function`s evaluated internally) connected via :class:`~Edge`s.

Variables:
  • id (str) – A unique identifier for this Graph

  • nodes (List[modeci_mdf.mdf.Node]) – One or more :class:`Node`(s) present in the graph

  • edges (List[modeci_mdf.mdf.Edge]) – Zero or more :class:`Edge`(s) present in the graph

  • parameters (Dict[str, Any] | None) – Dictionary of global parameters for the Graph

  • conditions (modeci_mdf.mdf.ConditionSet | None) – The ConditionSet stored as dictionary for scheduling of the Graph

Method generated by attrs for class Graph.

Methods

get_node(id)

Retrieve Node object corresponding to the given id

get_node(id: str) Node | None[source]

Retrieve Node object corresponding to the given id

Parameters:

id – Unique identifier of Node object

Returns:

Node object if the entered id matches with the id of node present in the Graph. None if a node is not found with that id .

property dependency_dict: Dict[Node, Set[Node]]

Returns the dependency among nodes as dictionary

Key: receiver, Value: Set of senders imparting information to the receiver

Returns:

Returns the dependency dictionary

property inputs: List[Tuple[Node, InputPort]]

Enumerate all Node-InputPort pairs that specify no incoming edge. These are input ports for the graph itself and must be provided values to evaluate

Returns:

A list of Node, InputPort tuples