Model.add_interaction
- Model.add_interaction(a, b)
Add an interaction between two elements of the model.
- Parameters:
- a
Element
The first element.
- b
Element
The second element.
- a
- Returns:
- tuple[int, int]
The edge of the interaction graph representing the interaction between the two elements.
- Raises:
- Exception
If one or both of the elements are not in the graph.
Notes
In future implementations, adding an interaction should implicitly take care of adding modifiers onto the interaction edges, based on the registered modifiers of the source nodes.
In the current implementation, modifiers have to be added explicitly using
add_modifiers()
. This method will add an interaction edge from the source of the modifier to its target if needed and store the modifier object on it.