def ToBox():
class ToBoxWrapper(gym.Wrapper):
"""
Wrapper to convert MultiDiscrete action space to Box
Only supports one config, which allows all keys to be pressed
"""
def __init__(self, env):
super(ToBoxWrapper, self).__init__(env)
self.action_space = gym.spaces.multi_discrete.BoxToMultiDiscrete(self.action_space)
def _step(self, action):
return self.env._step(self.action_space(action))
return ToBoxWrapper
评论列表
文章目录