Model.update_state()

Model.update_state()#

Model.update_state(position, model_state=None, inplace=False)[source]#

Updates and returns a model state given a position.

Parameters:
  • position (dict[str, TypeAliasType]) – A dictionary of variable or node names and values.

  • model_state (dict[str, NodeState] | None) – A dictionary of node names and their corresponding NodeState. If None (default), the model’s current state is used. (default: None)

  • inplace (bool) – If False (default), a new model state is returned, while the current model’s state is left unchanged. If True, the current model’s state is updated in place. (default: False)

Return type:

dict[str, NodeState]

Warning

The model_state must be up-to-date, i.e. it must not contain any outdated nodes. Updates can only be triggered through new variable or node values in the position. If you supply a model_state with outdated nodes, these nodes and their outputs will not be updated.