I tried use copy.deepcopy to make a copy of LunarLander-v2 environment , but it does not works. The return value of gym.step with same action are different between original environment and the copied one. Anyone who know the right way to copy the LunarLander-v2 gym[box2d] environment ?
Hmm, why are you trying to make a copy of it?
Because I am using the Monte Carlo tree search as the search algorithm. In tree search, It is necessary to make a replica of current state for tree expansion.
I'm afraid we don't really support that, and LunarLander is unlikely to work because it uses Box2D which may have its own internal state. Closing as a duplicate of https://github.com/openai/gym/issues/402
Thank you for your reply. But I think there must be some way to control its internal state since it have a reset method to reset state. so if the code can "reset with given state", we can simply make a new game and load that state to make a copy.
Most helpful comment
Because I am using the Monte Carlo tree search as the search algorithm. In tree search, It is necessary to make a replica of current state for tree expansion.