Skip to content

Problem with updating parameters #133

@antoniaih

Description

@antoniaih

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions