xsimlab.Model.update_state

Model.update_state(input_vars, validate=True, ignore_static=False, ignore_invalid_keys=True)

Update the model’s state (only input variables) with new values.

Prior to update the model’s state, first convert the values for model variables that have a converter, otherwise copy the values.

Parameters
  • input_vars (dict_like) – A mapping where keys are in the form of ('process_name', 'var_name') tuples and values are the input values to set in the model state.

  • validate (bool, optional) – If True (default), run the variable validators after setting the new values.

  • ignore_static (bool, optional) – If True, sets the values even for static variables. Otherwise (default), raises a ValueError in order to prevent updating values of static variables.

  • ignore_invalid_keys (bool, optional) – If True (default), ignores keys in input_vars that do not correspond to input variables in the model. Otherwise, raises a KeyError.