jxx123 / simglucose

A Type-1 Diabetes simulator implemented in Python for Reinforcement Learning purpose
MIT License
240 stars 113 forks source link

Increasing Documentation and Class Fields for Gym Model #6

Closed jparr721 closed 5 years ago

jparr721 commented 5 years ago

Hi Jinyu, my name is Jarred, and I am the one who was emailing with you last week about this project. I have made some improvements to model the OpenAI gym environments that exist in their in-house examples.

What does this change do?

This brings in additional documentation to the env for the gym-enabled simglucose application. As can be seen with cartpole on the OpenAI repository, they have clearly defined observation and action spaces. This PR adds that to allow for those following guides or hoping to adapt existing systems over to simglucose the ease of doing so without needing to hard code into their model.

Caveats

I am mostly sure about the observation and action space specifications outlined in the comments, but I don't know for sure if this is the proper parameters you were looking for. Please feel free to comment changes you're looking for and I would be happy to add them.

Thanks!

jxx123 commented 5 years ago

Hi Jarred, thanks very much for your contribution! I took a look at the change. I think you should make the change in the gym interface file, which is a wrapper of the internal environment class that you modified. Plus, the gym interface is already using spaces.Box to define the limits. The reason I made this gym environment wrapper was that I originally developed the environment that supports rllab only. The API for rllab and gym is very similar, and I then wrote a wrapper for gym.

jparr721 commented 5 years ago

Hi Jarred, thanks very much for your contribution! I took a look at the change. I think you should make the change in the gym interface file, which is a wrapper of the internal environment class that you modified. Plus, the gym interface is already using spaces.Box to define the limits. The reason I made this gym environment wrapper was that I originally developed the environment that supports rllab only. The API for rllab and gym is very similar, and I then wrote a wrapper for gym.

Hi Jinyu,

Thanks for the reply! I see now where I may have been confused here. I am curious though, when implementing this environment using gym I was unable to access the observation and action spaces, do you know why this might be?

Thanks!

jxx123 commented 5 years ago

Can you give me more details? How did you try to access the observation and action spaces?

Thanks, Jinyu