Skip to content

vicky-sunshine/maze-gym

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maze-gym

Learn how to build a open AI gym enviroment.

Environment

# python 3.6
gym==0.10.5
numpy==1.14.3
pandas==0.23.0

Maze map

Below is a 3 x 3 map:

0,0,0
0,2,0
2,3,0
  • 0: walkable road (reward 0)
  • 2: falling hole (reward -1, and stop walking)
  • 3: treasure (reward 1, and stop walking)

The adventurer will start at (1, 0), which means the second row and the first column The program will show 1 for adventurer.

Example:

0,0,0
1,2,0
2,3,0

You can specify the map config at MAZE_MAP_PATH variable in maze_env.py.

Run

Just run

python run_this.py

and it will walk!

Example console output:

======
choose action: up
[[0 1 0 2]
 [0 2 0 2]
 [2 0 0 0]
 [3 0 2 2]]
user loc: (0, 1)
======
choose action: right
[[0 0 1 2]
 [0 2 0 2]
 [2 0 0 0]
 [3 0 2 2]]
user loc: (0, 2)
======
choose action: left
[[0 1 0 2]
 [0 2 0 2]
 [2 0 0 0]
 [3 0 2 2]]
user loc: (0, 1)

...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published