42 add datadriven mpc #71
Open
sarahleidolf wants to merge 30 commits into
Open
Conversation
sarahleidolf
commented
Feb 25, 2026
Collaborator
- support datadriven mpc
- adjust collocation time grid specification to general time grid information to allow multiple shooting
This reverts commit b07d8a3
This reverts commit 43a6538
This reverts commit 7fd7811
note: not properly tested so far and did not check market with multiple shooting
# Resolved Conflicts: # agentlib_flexquant/data_structures/flex_results.py # agentlib_flexquant/generate_flex_agents.py # agentlib_flexquant/modules/shadow_mpc.py # agentlib_flexquant/utils/parsing.py
adjust example for linear regression / add to tests
add snapshots for linreg example
minor changes
FelixStege
requested changes
Feb 27, 2026
FelixStege
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the work! I left some minor comments
…to zero" was removed add model initialization in config validations, otherwise ML-model is not found
FelixStege
requested changes
May 20, 2026
FelixStege
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the work! Just some minor comments
| default=KPISeries(name="power_flex_offer", unit="kW", integration_method=LINEAR), | ||
| description="Power flexibility", | ||
| ) | ||
| power_flex_offer_prepared: KPISeries = pydantic.Field( |
Contributor
There was a problem hiding this comment.
Maybe power_flex_offer_prep_int?
| self.power_flex_offer_prepared.value = self.power_flex_offer_prepared.value.drop( | ||
| time_grid_info["grid"], errors="ignore" | ||
| ) | ||
| power_flex_offer = self.power_flex_offer_prepared.value.iloc[:-1] |
Contributor
There was a problem hiding this comment.
This is due to AgentLib-MPCs cost function, right? Can you add a short comment for that?
| collocation_time_grid, errors="ignore" | ||
| series=self.power_flex_offer_prepared, mpc_time_grid=mpc_time_grid | ||
| ) | ||
| # Calculate the average and stores the original value |
Comment on lines
+317
to
+318
| mpc_time_grid: the MPC time grid over the horizon | ||
| time_grid_info: Dictionary with 'type' and 'grid' keys for discretization info |
Contributor
There was a problem hiding this comment.
What is the difference between the mpc_time_grid and timegrid_info["grid"]? Maybe add a short description for that
Comment on lines
632
to
634
| # ensure the first value is nan, since it is calculated with the state from the | ||
| # controlled system and thus the same for baseline and shadow mpcs | ||
| series.iloc[0] = np.nan |
Contributor
There was a problem hiding this comment.
You can remove this part as well, since it also messes with the cost calculation, if I am not mistaken
| "field in the flex config." | ||
| ) | ||
| ) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.