Skip to content

Commit

Permalink
new gym spaces API with dtype; updated required packages
Browse files Browse the repository at this point in the history
  • Loading branch information
zuoxingdong committed Mar 19, 2018
1 parent 8aaeb4d commit 7033a1b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Maze.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.6.4"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ The repo will be actively maintained, any comments, feedbacks or improvements ar
# Dependencies

This repository requires following packages:
- gym >= 0.9.4
- Python >= 3.6
- Numpy >= 1.13.3
- Matplotlib >= 2.1.1
- gym >= 0.10.4
- Python >= 3.6.4
- Numpy >= 1.14.2
- Matplotlib >= 2.1.2
- Scikit-image >= 0.13.1
- (Recommended) JupyterLab >= 0.31.0
- (Recommended) JupyterLab >= 0.31.12

# Installation

Expand Down
12 changes: 8 additions & 4 deletions gym_maze/envs/maze.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ def __init__(self,
low_obs = 0 # Lowest integer in observation
high_obs = 6 # Highest integer in observation
if self.obs_type == 'full':
self.observation_space = spaces.Box(low=low_obs, high=high_obs,
shape=self.maze_size)
self.observation_space = spaces.Box(low=low_obs,
high=high_obs,
shape=self.maze_size,
dtype=np.float32)
elif self.obs_type == 'partial':
self.observation_space = spaces.Box(low=low_obs, high=high_obs,
shape=(self.pob_size*2+1, self.pob_size*2+1))
self.observation_space = spaces.Box(low=low_obs,
high=high_obs,
shape=(self.pob_size*2+1, self.pob_size*2+1),
dtype=np.float32)
else:
raise TypeError('Observation type must be either \'full\' or \'partial\'')

Expand Down
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
from setuptools import setup
import sys

# Only support Python 3
if sys.version_info.major != 3:
print(f'WARNING: This package only officially support Python 3, the current version is Python {sys.version_info.major}. The installation will likely fail. ')

setup(name='gym_maze',
version='1.0',
install_requires=['gym', 'numpy', 'scikit-image']
install_requires=['gym',
'numpy',
'matplotlib',
'scikit-image',
'jupyterlab'],
description='gym-maze: A customizable gym environment for maze and gridworld',
author='Xingdong Zuo',
url='https://github.com/zuoxingdong/gym-maze',
version='0.1'
)

0 comments on commit 7033a1b

Please sign in to comment.