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, default:None) – A dictionary of node names and their correspondingNodeState. IfNone(default), the model’s current state is used.inplace (
bool, default:False) – IfFalse(default), a new model state is returned, while the current model’s state is left unchanged. IfTrue, the current model’s state is updated in place.
- Return type:
Warning
The
model_statemust 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 theposition. If you supply amodel_statewith outdated nodes, these nodes and their outputs will not be updated.