modeci_mdf.mdf.Graph

class modeci_mdf.mdf.Graph(id: str, nodes: List[Node] = _Nothing.NOTHING, edges: List[Edge] = _Nothing.NOTHING, parameters: Optional[Dict[str, Any]] = None, conditions: Optional[ConditionSet] = None, *, metadata: Optional[Dict[str, Any]] = 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 (Optional[Dict[str, Any]]) – Dictionary of global parameters for the Graph

  • conditions (Optional[modeci_mdf.mdf.ConditionSet]) – 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) Optional[Node][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