Last active
November 12, 2019 10:14
-
-
Save fyr91/0ec6a92aa7513ad83ceb3de59f777bb5 to your computer and use it in GitHub Desktop.
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 import error, spaces, utils | |
from gym.utils import seeding | |
class FooEnv(gym.Env): | |
metadata = {'render.modes': ['human']} | |
def __init__(self): | |
# usually action and observation space will be defined here | |
# self.action_space = spaces.Discrete() ... | |
# self.observation_space = spaces.Box() ... | |
... | |
def step(self, action): | |
# step function will take action for each game step | |
... | |
def reset(self): | |
# reset an env state | |
... | |
def render(self, mode='human'): | |
# render env if needed | |
... | |
def close(self): | |
# properly close the env | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment