environment.py 文件源码

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

项目:async-deeprl 作者: dbobrenko 项目源码 文件源码
def __init__(self, env, actrep=4, memlen=4, w=84, h=84, random_start=30):
        print('Creating wrapper around Gym Environment')
        self.env = env
        self.memlen = memlen
        self.W = w
        self.H = h
        self.actrep = actrep
        self.random_start = random_start
        if not isinstance(self.env.action_space, spaces.Discrete):
            raise ValueError("Unsupported environment's (%s) action space. Expected: %s, Got: %s." %
                             (self.env.spec.id, self.env.action_space, spaces.Discrete))
        self.action_space = list(range(self.env.action_space.n))
        self.action_size = len(self.action_space)
        self.stacked_s = None
        for key in __custom_actions__:
            if key == self.env.spec.id:
                self.set_custom_actions(__custom_actions__[key])
                break
        print('Environment: %s. Action space: %s' % (self.env.spec.id, self.action_space))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号