-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with updating parameters #133
Comments
Do you mean that a modeling function might change a parameter value that overrides what the user has set in the UI? |
Yes. But not only the user input but also the previous parameter state in general. I do not override existing parameters. |
Ok. What do we want to happen? One strategy is to save all parameters manually input by the user and let these override whatever is created automatically. The ones that were never changed manually we can allow being changed by the model transformations. |
But they cannot be saved inside the model state because then we do not know if they have been recently changed or not. A parameter changed by the user could still be updated by the modeling functions. |
So we keep all changed parameters by the user and these always takes precedence (unless removed) over automatically changed parameters. So there will be a |
The current solution for this is that |
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 inmodel_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.The text was updated successfully, but these errors were encountered: