There are situations in which you would want to do a rollout from the current env state (say for estimating the return from that given state) and then continue from that point on. For mujoco envs you can do something along:
saved_state = env.sim.get_state()
# then on some other process or in a different routine
env.sim.set_state(saved_state)
I poked around the env object returned by gym.make() and there doesn't seem a way right now. Simply using deepcopy won't cut it. Any pointers towards how it could be implemented? I'd be willing to look into this.
I dug up a bit and found this pybullet save/load example. It seems to be working fine in a multiprocessing environment when saving and loading state from disk. Couldn't make it work to restore from memory id.
There are situations in which you would want to do a rollout from the current env state (say for estimating the return from that given state) and then continue from that point on. For
mujoco
envs you can do something along:I poked around the env object returned by
gym.make()
and there doesn't seem a way right now. Simply usingdeepcopy
won't cut it. Any pointers towards how it could be implemented? I'd be willing to look into this.