Package kuimaze :: Module gym_wrapper :: Class EasyMazeEnv
[hide private]
[frames] | no frames]

Class EasyMazeEnv

source code

gym.Env --+    
          |    
    MazeEnv --+
              |
             EasyMazeEnv

EasyMazeEnv is version of maze closer to graph search. It is possible to move agent from any state to different one already visited or neighbour state of current one. EasyMaze has all methods of HardMaze. Unlike the HardMaze, EasyMaze has additional method set_path - which can set different path than agent movement.

Instance Methods [hide private]
 
__init__(self, informed, map_image_dir=None, grad=(0,0))
Class wrapping Maze into gym enviroment.
source code
 
step(self, action) source code
 
set_path(self, path)
This method sets enviroment to visualize your found path.
source code
 
_is_available(self, new_state)
returns true if new state is available
source code
 
_easy_result(self, state_list)
Gives result of desired action in parameter
source code
 
_get_cost(self, curr, last)
returns cost of movement from last to curr
source code
 
expand(self, position)
returns tuple of positions with associated costs that can be visited from "position"
source code

Inherited from MazeEnv: close, get_all_states, render, reset, save_eps, save_path, seed, visualise

Class Variables [hide private]

Inherited from MazeEnv: MAP, metadata

Inherited from MazeEnv (private): _path, _visited

Method Details [hide private]

__init__(self, informed, map_image_dir=None, grad=(0,0))
(Constructor)

source code 

Class wrapping Maze into gym enviroment.

Parameters:
  • informed - boolean
  • gym_compatible - boolean - T = HardMaze, F = EasyMaze
  • deter - boolean - T = deterministic maze, F = probabilistic maze
  • map_image_dir - string - path to image of map
  • grad - tuple - vector tuning the tilt of maze`
Overrides: MazeEnv.__init__
(inherited documentation)

step(self, action)

source code 
Overrides: MazeEnv.step

set_path(self, path)

source code 

This method sets enviroment to visualize your found path. Method render, must be called afterwards.

Parameters:
  • path - list of lists in format: [[x1, y1], [x2, y2], ... ]
Returns:
None

_is_available(self, new_state)

source code 

returns true if new state is available

Parameters:
  • new_state
Returns:
boolean

_easy_result(self, state_list)

source code 

Gives result of desired action in parameter

Parameters:
  • state_list - list or tuple of coordinates [x, y]
Returns:
state - new position of agent

_get_cost(self, curr, last)

source code 

returns cost of movement from last to curr

Parameters:
  • curr - new state
  • last - last state
Returns:
float

expand(self, position)

source code 

returns tuple of positions with associated costs that can be visited from "position"

Parameters:
  • position - position in the maze defined by coordinates (x,y)
Returns:
tuple of coordinates [x, y] with "cost" for movement to these positions: [[[x1, y1], cost1], [[x2, y2], cost2], ... ]