Reset simulator to specific state (e.g., state previously seen during an episode)

Hi. Is there a way to reset the environment to a previous state, and restart the simulation from that point forward?

Nudge @lukasz_kidzinski !

He should be able to answer this.

Best of Luck! :smiley:

1 Like

Hi! These two functions should do the job


You can access the OpenSim model through

I hope that helps!

2 Likes

Thanks, for the reply @lukasz_kidzinski! Looks like that’s working :slight_smile:

Hi @lukasz_kidzinski. Is there any way to serialize or correctly populate the environment state if one wants to set copies of the environment running on different process/machines to exactly the same state? Seems like a simple pickle does not work for SWIG objects, so I was thinking if it was possible to serialize the values themselves, and if so, which ones are important.

Hi, you would need to loop through all variables of the state, serialize them and reinitialize the state. We don’t have a function for that yet, but it should be technically possible. Here is some useful starting point


Please follow up in that issue (or start another one in github) – it will be easier for me to bring in developers of OpenSim to the discussion.

1 Like