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))
评论列表
文章目录