Skip to content

Commit

Permalink
fix a bug that sometimes caused shared memory objects persist through…
Browse files Browse the repository at this point in the history
… timesteps
  • Loading branch information
inoryy committed Jan 2, 2019
1 parent 57bfb36 commit 900017d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reaver/agents/base/running.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ def run(self, env: Env, n_steps=1000000):
def _run(self, env, n_steps):
self.on_start()
obs, *_ = env.reset()
obs = [o.copy() for o in obs]
for step in range(self.start_step, self.start_step + n_steps):
action, value = self.get_action_and_value(obs)
self.next_obs, reward, done = env.step(action)
self.on_step(step, obs, action, reward, done, value)
self.on_step(step, [o.copy() for o in obs], action, reward, done, value)
obs = [o.copy() for o in self.next_obs]
env.stop()
self.on_finish()
Expand Down

0 comments on commit 900017d

Please sign in to comment.