Skip to content

Conversation

@lwaer
Copy link
Collaborator

@lwaer lwaer commented Jan 7, 2026

No description provided.

@lwaer lwaer requested a review from FelixStege January 7, 2026 15:33
@lwaer lwaer linked an issue Jan 7, 2026 that may be closed by this pull request
@lwaer lwaer self-assigned this Jan 7, 2026
Copy link
Contributor

@FelixStege FelixStege left a 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!

@FelixStege FelixStege marked this pull request as draft January 9, 2026 15:44
@lwaer lwaer changed the title implemented feature Baseline Power Prediction as Input for Shadow MPCs Jan 13, 2026
@lwaer
Copy link
Collaborator Author

lwaer commented Jan 13, 2026

I reviewed my implementations to be more dynamic. Now, custom_inputs can be defined in the flex_config.shadow_mpc_config_generator_data.

@lwaer lwaer marked this pull request as ready for review January 14, 2026 13:06
@lwaer
Copy link
Collaborator Author

lwaer commented Jan 14, 2026

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?

@FelixStege
Copy link
Contributor

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

@lwaer lwaer requested a review from FelixStege January 14, 2026 14:02
@lwaer
Copy link
Collaborator Author

lwaer commented Jan 14, 2026

"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. ],

@lwaer lwaer closed this Jan 19, 2026
@lwaer lwaer reopened this Jan 19, 2026
Copy link

Copilot AI left a 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 PFMPCData and NFMPCData to remove the weights attribute and use config_parameters_appendix and config_inputs_appendix with model validators that add default framework parameters
  • Added custom_inputs field to ShadowMPCConfigGeneratorConfig to support additional inputs for Shadow MPCs
  • Updated generate_flex_agents.py to 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.

lwaer and others added 4 commits January 20, 2026 11:15
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.
Copy link

Copilot AI left a 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
Copy link

Copilot AI left a 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.

lwaer and others added 4 commits January 20, 2026 15:12
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>
Copy link

Copilot AI left a 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.

lwaer and others added 3 commits January 20, 2026 15:24
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>
@lwaer lwaer requested a review from FelixStege January 20, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Baseline Power Prediction as Input for Shadow MPCs

4 participants