action_space.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:super_mario 作者: tsunaki00 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号