Skip to content
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

Endpoint to get all measurement/setpoints at current simulation time #359

Closed
mschaar opened this issue Sep 16, 2021 · 9 comments
Closed

Comments

@mschaar
Copy link

mschaar commented Sep 16, 2021

I'm part of the RWTH agentlib team and want to implement the BOPTEST module into our multi agent system library.
The current problem is to get all controller setpoints from BOPTEST to pass them to my multi agent controllers. It would be nice to have an endpoint to get all available points at the current simulation time (or pass a list with the needed points) - Example Endpoint: GET /current_states, PARAMETER: point_list, if point_list is empty just return all points.

Maybe I misunderstood the documentation and there is a way to get all current values from your api. If there are any uncertainties in my description, please let me know.

@javiarrobas
Copy link
Contributor

Hey @mschaar, thanks for reaching out! I'm not sure I understand your issue, though. The available set of setpoints is invariant during runtime and can be retrieved at all times using GET inputs. Then, the subset of inputs to overwrite is selected with the "activate" variables in the data passed to the advance call.
If you're asking for the setpoints used by the baseline controller of the emulator, those can be obtained from the measurements. The available set of measurements can be obtained with GET measurements or from the testcase documentation.
Did you have a look at this tutorial? it may be of great help.

@mschaar
Copy link
Author

mschaar commented Sep 16, 2021

Hi @JavierArroyoBastida, maybe it is easier to talk via MS Teams, then it is much easier to describe the problem. Do you have time for this?

@javiarrobas
Copy link
Contributor

This week is a bit tight for me. Maybe we could arrange a call for next week. A description through here would be appreciated though since it can be useful to others in the future.

@dhblum
Copy link
Collaborator

dhblum commented Sep 16, 2021

To get current values for all measurement points, you can do something like (pseudo-code):

points = GET /measurements
for point in points:
   data[point] = PUT /results with point_name=point, start_time=current_time, final_time=current_time 

Does this help?

@mschaar
Copy link
Author

mschaar commented Sep 25, 2021

This is the solution I'm using right now. This is slowing down the simulation... Isn't it possible to implement something like:

points = requests.get( /measurements ).json()
print(points)

{ .... 'conCooRo2_reaCoo_y': {'Minimum': None, 'Description': 'Cooling control signal measurement as fraction of maximum for zone Ro2', 'Unit': '1', 'Maximum': None, value=10 }, ....}

That the current simulation value is added to the measurement field, this would safe much requests and time.

@dhblum
Copy link
Collaborator

dhblum commented Sep 27, 2021

Ok I see. The current values of all measurements are returned when using /advance. I'd just like to know, is this still not sufficient?

@mschaar

This comment has been minimized.

@dhblum
Copy link
Collaborator

dhblum commented Jan 5, 2022

@mschaar Wanted to let you know that we've closed Issue #364 via PR #377. This implements a fix so that data for control signals returned through the /advance and /results requests are equal to the baseline signals if not being overwritten and equal to the overwriting value if overwritten. This will allow you to get the baseline set point data. Note also that the current state values of all points are still returned when the /advance call completes, or obtainable otherwise with the /results request.

@dhblum
Copy link
Collaborator

dhblum commented Aug 21, 2024

Closing as addressed and stale.

@dhblum dhblum closed this as completed Aug 21, 2024
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

No branches or pull requests

3 participants