forked from simondlevy/gym-mygame
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c19acae
commit 05cf915
Showing
7 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.swp | ||
*~ | ||
*.egg-info | ||
__pycache__/ | ||
build/ | ||
dist/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from mygame import MyGame | ||
from gym_mygame.envs.mygame import MyGame |
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
''' | ||
Python distutils setup file for gym-mygame module. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
''' | ||
Python distutils setup file for gym-mygame module. | ||
Adapted from http://gym.openai.com/docs/ | ||
Copyright (C) 2020 Simon D. Levy | ||
MIT License | ||
''' | ||
|
||
import gym | ||
|
||
env = gym.make('gym_mygame:MyGame-v0') | ||
|
||
for i_episode in range(20): | ||
observation = env.reset() | ||
for t in range(100): | ||
env.render() | ||
print(observation) | ||
action = env.action_space.sample() | ||
observation, reward, done, info = env.step(action) | ||
if done: | ||
print("Episode finished after {} timesteps".format(t+1)) | ||
break | ||
|
||
env.close() |