upb-lea / openmodelica-microgrid-gym

OpenModelica Microgrid Gym (OMG): An OpenAI Gym Environment for Microgrids
GNU General Public License v3.0
179 stars 33 forks source link

Example doesn't work right out of the box. #139

Open JvPost opened 1 week ago

JvPost commented 1 week ago

Im trying to run the examples single_inverter_current_control_safe_opt.py and single_inverter_voltage_current_control_safe_opt.py.

Both have an issue with the reward function. Specifically, the line phase = data[idx[1]] # phase from the master controller needed for transformation has an error. It's the fourth line in the reward function. The data passed to the reward function has not enough indeces to follow the pattern performed in the set_idx method.

I'm running on wsl in python=3.8.18. I've installed the packages in the requirements.txt and the omg package.

stheid commented 1 week ago

Do the simpler examples work for you? Unfortunately, i have no installed version of the code any more.

What exactly are you trying to achieve.

Webbah commented 1 week ago

Can you send a screenshot of how the error and data and idx look like?

On my end it is working and looks like that: image