Reset gym environment with an observation
Posted: Tue Oct 16, 2018 3:10 pm
Hi everyone !
I would like to create a controller for the gym Hopper environment. Therefore I would like to create a state/dynamics equation to use afterwards finite difference. This dynamic function should have an observation and action as input and the next state as output, so somewhat similar to this pseudo-code:
Therefore it is necessary to reset the environment with a given observation (and change the observations/state to calculate the derivative..). And this is the problem: I cannot find a solution to set the environment to a specific state given an observation.
I know that I can use following commands to save and restore a state but this doesn't help since I want to set the environment to a state given any observation without visiting and saving it before..
So in the end my question is: Is there any way to realize the dynamics function ? Or a solution to reset the environment with a given observation? Or any other advice to solve my problem?
Thank you very much in advance for any advice and kind regards !
I would like to create a controller for the gym Hopper environment. Therefore I would like to create a state/dynamics equation to use afterwards finite difference. This dynamic function should have an observation and action as input and the next state as output, so somewhat similar to this pseudo-code:
Code: Select all
def state_equation(observation, action):
env.set_state(observation) #THIS function is missing..
next_state, _, _, _ = env.step(action)
return next_state
I know that I can use following commands to save and restore a state but this doesn't help since I want to set the environment to a state given any observation without visiting and saving it before..
Code: Select all
stateId = p.saveState()
p.restoreState(stateId)
Thank you very much in advance for any advice and kind regards !