Skip to content
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

Iterative resource allocation (solve) #341

Open
jetuk opened this issue Feb 3, 2025 · 0 comments
Open

Iterative resource allocation (solve) #341

jetuk opened this issue Feb 3, 2025 · 0 comments
Labels
core Relates to the pywr-core crate enhancement New feature or request

Comments

@jetuk
Copy link
Member

jetuk commented Feb 3, 2025

There has been a request to add the ability to iterative re-solve the resource allocation (LP) procedure in each time-step. This would be for cases where the allocation (e.g. a parameter) is dependent on the current time-step's flow. Currently, this is only possible by using previous time-step's data as an approximation, or estimating current time-step's expected flow by manually calculating flows in a custom parameter. The latter approach is difficult and can not know exactly what the allocation will be.

Therefore, one method would be to re-solve the LP with updated information / estimates from the first solve. And continue this iteration until convergence (or a limit is reached).

Requirements

  • A new Metric variant that refers to current flow, or makes an explicit separate between previous and current flow.
  • Implement the solve iteration loop.
  • Handle iterative state changes.
    • Current mutable state is updated during solve.
    • Need to handle storing previous time-step's flows.
    • Storing an iterative sequence of flows from each iteration (or could just be current and last iteration?).
    • Rewinding storage changes or only updating storage once iteration is complete.
  • Estimate convergence as the difference between flows on successive time-steps? Perhaps only those flows which are being used in Metrics.
  • Solver settings to configure the resolve feature, maximum iterations, convergence, etc.
@jetuk jetuk added core Relates to the pywr-core crate enhancement New feature or request labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Relates to the pywr-core crate enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant