Created
April 18, 2017 14:56
-
-
Save cocomoff/aff7ee699d08c68f79f1c0953d05e9fa to your computer and use it in GitHub Desktop.
Simple Taxi Domain example using OpenAI Gym
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
import gym | |
from gym.wrappers import Monitor | |
def main(): | |
GAME = "Taxi-v2" | |
env = gym.make(GAME) | |
n_state = env.observation_space.n | |
n_action = env.action_space.n | |
env = Monitor(env, "taxi_simple", force=True) | |
s = env.reset() | |
steps = 10 | |
for step in range(steps): | |
env.render() | |
action = env.action_space.sample() | |
s, r, done, info = env.step(action) | |
# close environment and monitor | |
env.close() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment