rename to the proper form
This commit is contained in:
parent
e19382cc2b
commit
a1198af230
@ -1,15 +1,21 @@
|
|||||||
import gym
|
import gym
|
||||||
from gym import error, spaces, utils
|
from gym import error, spaces, utils
|
||||||
from gym.utils import seeding
|
from gym.utils import seeding
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
class RandomWalkEnv(gym.Env):
|
class RandomWalkEnv(gym.Env):
|
||||||
metadata = {'render.modes': ['human']}
|
metadata = {'render.modes': ['human']}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
self.action_space = spaces.Discrete(2)
|
||||||
print("init")
|
print("init")
|
||||||
def _step(self, action):
|
def _step(self, action):
|
||||||
print("step")
|
print("step")
|
||||||
|
reward = 0
|
||||||
|
done = False
|
||||||
|
return np.array(self.state), reward, done, {}
|
||||||
def _reset(self):
|
def _reset(self):
|
||||||
print("reset")
|
print("reset")
|
||||||
|
self.state = 0 # TODO start in a random position
|
||||||
def _render(self, mode='human', close=False):
|
def _render(self, mode='human', close=False):
|
||||||
print("render")
|
print("render")
|
Loading…
Reference in New Issue
Block a user