-
Notifications
You must be signed in to change notification settings - Fork 0
Baseline Power Prediction as Input for Shadow MPCs #43
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
base: main
Are you sure you want to change the base?
Baseline Power Prediction as Input for Shadow MPCs #43
Conversation
FelixStege
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for the work! I added some comments. Fell free to ask if anything is unclear!
tests/snapshots/test_SimpleBuilding/test_simplebuilding/SimpleBuilding_neg_flex_summary.json
Outdated
Show resolved
Hide resolved
|
I reviewed my implementations to be more dynamic. Now, custom_inputs can be defined in the flex_config.shadow_mpc_config_generator_data. |
|
We should check for the order, in which the MPCs run. Is it necessary to implement callbacks for the Shadow-MPCs to wait for the Baseline-MPC? |
This is already implemented, as the shadow MPCs wait for the full control trajectory of the Baseline. This is needed, since the controls of the shadow MPCs are constrained to the controls of the Baseline during market time |
"custom_inputs": [
{"name": "P_el_base", "alias": "_P_el_base", "value": 0},When initializing the baseline trajectory with value=0, everything runs smoothly. However, an initialization should in theory not be necessary for this variable, as the alias points on the baseline variable after the baseline runs. ], |
…ower-prediction-as-input-for-shadow-mpcs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the MPC configuration system to support custom inputs (like baseline power predictions) for Shadow MPCs. The main change replaces the weights attribute with a more flexible system using config_parameters_appendix and config_inputs_appendix lists.
Changes:
- Refactored
PFMPCDataandNFMPCDatato remove theweightsattribute and useconfig_parameters_appendixandconfig_inputs_appendixwith model validators that add default framework parameters - Added
custom_inputsfield toShadowMPCConfigGeneratorConfigto support additional inputs for Shadow MPCs - Updated
generate_flex_agents.pyto use the new parameter/input appendix system - Added example FMU configuration file for SimpleBuilding
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
agentlib_flexquant/data_structures/mpcs.py |
Removed weights attribute from BaseMPCData, PFMPCData, and NFMPCData; added model validators to automatically include default framework parameters and inputs |
agentlib_flexquant/data_structures/flexquant.py |
Added custom_inputs field and updated assign_weights_to_flex validator to assign weights and custom inputs to Shadow MPCs |
agentlib_flexquant/generate_flex_agents.py |
Removed code that handled weights separately; updated to use config_parameters_appendix and config_inputs_appendix throughout |
agentlib_flexquant/utils/parsing.py |
Added loop to append custom inputs from config_inputs_appendix when modifying Shadow MPC config classes |
examples/SimpleBuilding/mpc_and_sim/fmu_config_linux.json_temp |
New example configuration file for FMU-based simulation |
.gitignore |
Added .vscode/ and flexquant.egg-info/ to ignored patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Allows appending custom parameters to the shadow MPC configurations. Now it extends existing `config_parameters_appendix` and `config_inputs_appendix` instead of overwriting them. This change ensures that default/pre-existing parameters are preserved when adding custom parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refactors MPC data validation to ensure default parameters and inputs are included in the respective appendix lists. It introduces a helper function to simplify the process of adding missing default variables based on their names. This ensures that critical framework parameters are always present in the MPC configurations. The previous implementation in ShadowMPCConfigGeneratorConfig was redundant and has been simplified. Relates to #42
Ensures MPC variables are correctly initialized when loaded from dictionaries. Adds an example FMU configuration and associated simulation result file to showcase the interaction between MPC and FMU simulations within the framework. Adds FMU config to .gitignore. Swaps the position of `flex_event_duration` and `market_time` in the tests to ensure the correct parameter order. Related to #42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 15 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.