[rllib] Upgrade to OpenAI Gym 0.10.3 (#1601)

This commit is contained in:
butchcom
2018-03-06 00:31:02 -08:00
committed by Richard Liaw
parent 162d063f0d
commit 936bebef99
11 changed files with 63 additions and 49 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import gym
from gym.spaces import Discrete, Box
from gym.envs.registration import EnvSpec
@@ -22,7 +23,8 @@ class SimpleCorridor(gym.Env):
self.end_pos = config["corridor_length"]
self.cur_pos = 0
self.action_space = Discrete(2)
self.observation_space = Box(0.0, self.end_pos, shape=(1,))
self.observation_space = Box(
0.0, self.end_pos, shape=(1,), dtype=np.float32)
self._spec = EnvSpec("SimpleCorridor-{}-v0".format(self.end_pos))
def _reset(self):