Repository navigation
95 objective evaluation for complex objective - #132
Open
frederikmuthers wants to merge 11 commits into
Open
frederikmuthers wants to merge 11 commits into
frederikmuthers wants to merge 11 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (4)
examples/one_room_mpc/physical/simple_mpc_objective_testing.py:298
if with_dashboard:is duplicated, creating an unnecessary nested conditional and indentation. This is likely accidental and makes the example harder to read.
if with_dashboard:
if with_dashboard:
from agentlib_mpc.utils.analysis import load_mpc_stats
agentlib_mpc/data_structures/objective.py:28
- _replace_subexpressions() uses a regex that stops each @n=... definition at the first comma, so any subexpression containing commas (e.g., function calls like if_else(..., ..., ...)) will be truncated and inlined incorrectly, leading to invalid/wrong eval strings.
# Extract all subexpression definitions using regex
defs = dict(re.findall(r"(@\d+)=(.*?),\s*", expr_str))
# Remove the definitions from the expression string
clean_expr = re.sub(r"@\d+=.*?,\s*", "", expr_str)
examples/one_room_mpc/physical/simple_mpc_objective_testing.py:176
- This block assigns to
conditionrepeatedly, so only the final assignment is actually used. This makes the example misleading (it looks like multiple cases are being tested, but they are dead code).
This issue also appears on line 296 of the same file.
condition = self.time < self.switch.sym
condition = self.time <= self.switch.sym
condition = self.time >= self.switch.sym
condition = self.time == self.switch.sym
condition = self.time != self.switch.sym
examples/one_room_mpc/physical/simple_mpc_objective_testing.py:329
- Spelling: "Absoulute" should be "Absolute".
print(f"Absoulute integral error: {aie_kh} Kh.")
# Conflicts: # agentlib_mpc/data_structures/objective.py
sarahleidolf
requested changes
Aug 13, 2026
sarahleidolf
left a comment
Contributor
There was a problem hiding this comment.
- Add new objective function to ci tests
- If possible, reduce the computation time required to calculate the objective values
This branch has not been deployed
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.
Pull Request
Description
Added functionality to clean up objectives in string format to make them compatible with the python eval functionality.
Type of Change