Created
May 21, 2016 04:40
-
-
Save PuZZleDucK/c7eccccfb10fedc3c17370a977ae2b66 to your computer and use it in GitHub Desktop.
My first Atari simulation with simple summary of results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# My first Atari simulation on the AIgym | |
# Not much happening yet | |
import gym | |
env = gym.make('MsPacman-v0') | |
print env.action_space | |
print env.observation_space | |
env.monitor.start('/tmp/atari-experiment-2') | |
env.reset() | |
for episode in range(20): | |
obervation = env.reset() | |
total_reward = 0 | |
for time in range(1000): | |
env.render() | |
action = env.action_space.sample() | |
observation, reward, done, info = env.step(action) | |
total_reward = total_reward + reward | |
if done: | |
print "Episode {}:".format(episode) | |
print " completed in {} steps".format(time+1) | |
print " total_reward was {}".format(total_reward) | |
break | |
env.monitor.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment