def run_episode(self, env: gym.Env):
meta_wrapper = get_wrapper(env, chi.rl.wrappers.Wrapper)
done = False
ob = env.reset()
a, meta = self.act(ob)
rs = []
while not done:
if meta_wrapper:
meta_wrapper.set_meta(meta) # send meta information to wrappers
ob, r, done, info = env.step(a)
a, meta = self.act(ob, r, done, info)
rs.append(r)
return sum(rs)
评论列表
文章目录