thomashirtz / gym-hybrid

Collection of OpenAI parametrized action-space environments.
55 stars 9 forks source link

compatible with gym>=0.24.1 && fix bug #8

Closed BepfCp closed 1 year ago

BepfCp commented 1 year ago

I mainly fix the environment.py to make it compatible with the latest version of gym (0.24.1), see more details in 'Files changed'

thomashirtz commented 1 year ago

Thank you for the contribution ! Can I know what was the compatibility issue before I accept the MR ?

BepfCp commented 1 year ago

Thank you for the contribution ! Can I know what was the compatibility issue before I accept the MR ?

Thank you for your reply. The compatibility issue are mainly caused by gym's own passive_env_checker.py. Below is one compatibility issue when running gym_hybird on gym==0.24.1. image

But I am not sure whether it is a bug of gym, because this compatibility issue is gone when upgrading gym to 0.25.0.

thomashirtz commented 1 year ago

I would like to first try to not use numpy array everywhere, if it doesn't pass the compatibility check with simple list, we may change it to numpy arrays as you did.

For the distance, since we are searching the hypotenuse, we have a²+b²=c², so I am not sure why you added (2*np.sqrt(2))

Nice catch for the import of the time as well as the order of the observation's limits :)

BepfCp commented 1 year ago

I would like to first try to not use numpy array everywhere, if it doesn't pass the compatibility check with simple list, we may change it to numpy arrays as you did.

For the distance, since we are searching the hypotenuse, we have a²+b²=c², so I am not sure why you added (2*np.sqrt(2))

Nice catch for the import of the time as well as the order of the observation's limits :)

Sorry for my late reply. I added (2*np.sqrt(2)) to make the distance into [0, 1], also due to the compatibility issue.

pseudo-rnd-thoughts commented 1 year ago

Hey, I believe that the error reported above was due to a bug in gym v24.1 that is fixed in v25. I would test with that to see if there is still an issue