-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Sometimes parameters get updated. For example when adding a dataset. Or when adding a transit compartment.
This is because when the model structure is changed new parameters might be added or existing parameters might be removed. Therefore model_state.parameters is updated to include new parameters and unused ones are removed. In other words the intersection between the model_state parameters and the model parameters (the model that is being built from the model state).
Parameters that exist in both are kept as they are. So a parameter whose initial value is different in the model than in model_state.parameters is changed so that it matches the one in model_state.parameters.
The problem is to know which set is the correct one. When we always update from the model it is not possible to change parameters in the parameter tab. Ideally we would want to know if the model features have been changed and in that case set model_state.parameters = model.parameters. But we do not know if the model features have been changed since there is no memory of a previous state. We would have to evaluate this outside of the model state.