Skip to content

Commit

Permalink
Slightly refactored enjoy
Browse files Browse the repository at this point in the history
  • Loading branch information
lcswillems committed May 31, 2018
1 parent 4bc0dd0 commit d8a8dda
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rl/scripts/enjoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@

# Run the agent

obs = env.reset()
done = False
print("Mission: {}".format(obs["mission"]))
done = True

while True:
time.sleep(args.pause)
renderer = env.render("human")

if done:
print("Reward:", reward)
obs = env.reset()
print("Mission: {}".format(obs["mission"]))

if renderer.window is None:
break

action = agent.get_action(obs)
obs, reward, done, _ = env.step(action)
agent.analyze_feedback(reward, done)

if done:
print("Reward:", reward)

if renderer.window is None:
break

0 comments on commit d8a8dda

Please sign in to comment.