MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / step

Method step

rl3/a2c/atari_wrappers.py:69–81  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

67 self.was_real_done = True
68
69 def step(self, action):
70 obs, reward, done, info = self.env.step(action)
71 self.was_real_done = done
72 # check current lives, make loss of life terminal,
73 # then update lives to handle bonus lives
74 lives = self.env.unwrapped.ale.lives()
75 if lives < self.lives and lives > 0:
76 # for Qbert sometimes we stay in lives == 0 condtion for a few frames
77 # so its important to keep lives > 0, so that we only reset once
78 # the environment advertises done.
79 done = True
80 self.lives = lives
81 return obs, reward, done, info
82
83 def reset(self, **kwargs):
84 """Reset only when lives are exhausted.

Callers

nothing calls this directly

Calls 1

stepMethod · 0.45

Tested by

no test coverage detected