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 correspondingNodeState
. IfNone
(default), the model’s current state is used. (default:None
)inplace (
bool
) – 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. (default:False
)
- Return type:
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 theposition
. If you supply amodel_state
with outdated nodes, these nodes and their outputs will not be updated.