Skip to content

52 integrate with agentlibs new dashboard#63

Open
EserSteffen wants to merge 39 commits intomainfrom
52-integrate-with-agentlibs-new-dashboard
Open

52 integrate with agentlibs new dashboard#63
EserSteffen wants to merge 39 commits intomainfrom
52-integrate-with-agentlibs-new-dashboard

Conversation

@EserSteffen
Copy link
Copy Markdown
Contributor

Integrate mpc visualization with version 0.9.0 of AgentLib, which offers mas-wide dashboard.

FWuellhorst and others added 30 commits December 19, 2024 12:42
# Conflicts:
#	CHANGELOG.md
# Conflicts:
#	CHANGELOG.md
#	agentlib_mpc/__init__.py
@EserSteffen EserSteffen linked an issue Aug 9, 2025 that may be closed by this pull request
# Conflicts:
#	CHANGELOG.md
#	agentlib_mpc/__init__.py
#	agentlib_mpc/modules/minlp_mpc.py
#	agentlib_mpc/optimization_backends/casadi_/admm.py
#	agentlib_mpc/optimization_backends/casadi_/full.py
# Conflicts:
#	CHANGELOG.md
#	agentlib_mpc/__init__.py
t_sample: float = Field(
default=60, description="Sends the active variable every other t_sample"
)
public_active_message: Optional[AgentVariable] = Field(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

würden hier nicht auch einfach booleans reichen?
Wäre denke ich erstmal intuitiver für die Nutzung in der Config. Man könnte ja trotzdem noch in der Funktion eine erklärmessage implementieren, falls erwünscht?

Braucht man wirklich inactive und active wenn es nur an und aus gibt? Reicht dann nicht ein Wert?


# 1. Get current MPC status (assume variable exists and is bool)
mpc_flag_var = self.get(self.config.mpc_active_flag.name)
mpc_is_active = bool(mpc_flag_var.value) # Assume value is not None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wäre es nicht sinnvoll hier einen Check einzubauen? Wenn die assumption nicht passt, könnte es nervig werden und None ergibt False. Weiß nicht, ob das hier gleichzusetzen ist.

for state_name in self.var_ref.states:
state_trajectory = df["variable"][state_name]
# Convert index (which starts at 0) to actual timestamps
for idx, value in state_trajectory.items():
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hier Index evtl. umbenennen. Das sind ja eig die Zeitschritte (klar auch index) aber so nicht ganz so leicht verständlich aus meiner Sicht

# Check if measurement is too old
if measurement_time is None:
# probably default value, we don't have fallback anyway
measurement_age = 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kommentar erweitern

)

def do_step(self):
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function is implemented twice at the moment. see above

# Call parent method to handle actuation
super().set_actuation(solution)

# class AgVarDropin:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this code?


if self.config.results_file.is_file():
if self.results_file_exists():
# todo, this case is weird, as it is the mistake-append
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the problem here?

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.

Integrate with AgentLibs new dashboard

5 participants