Move _reset() in constructor to below the definitions of action_space (#220)

This commit is contained in:
Matt Harvey
2016-06-19 15:38:25 -07:00
committed by Jonas Schneider
parent a7e5a581dc
commit 92d5c9458a

View File

@@ -86,13 +86,14 @@ class LunarLander(gym.Env):
self.particles = [] self.particles = []
self.prev_reward = None self.prev_reward = None
self._reset()
# useful range is -1 .. +1 # useful range is -1 .. +1
high = np.array([np.inf]*8) high = np.array([np.inf]*8)
# nop, fire left engine, main engine, right engine # nop, fire left engine, main engine, right engine
self.action_space = spaces.Discrete(4) self.action_space = spaces.Discrete(4)
self.observation_space = spaces.Box(-high, high) self.observation_space = spaces.Box(-high, high)
self._reset()
def _seed(self, seed=None): def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed) self.np_random, seed = seeding.np_random(seed)