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

Class MazeEnv

source code

gym.Env --+
          |
         MazeEnv

Instance Methods [hide private]
 
__init__(self, informed, gym_compatible, deter, map_image_dir=None, grad=(0,0), node_rewards=None)
Class wrapping Maze into gym enviroment.
source code
 
step(self, action) source code
 
get_all_states(self)
auxiliary function for MDPs - where states (map) are supposed to be known :return: list of states
source code
 
reset(self) source code
 
render(self, mode='human', close=False, visited=None, explored=None) source code
 
close(self) source code
 
seed(self, seed=None) source code
 
save_path(self)
Method for saving path of the agent into the file named 'saved_path.txt' into the directory where was the script runned from.
source code
 
save_eps(self)
Save last rendered image into directory where the script was runned from.
source code
 
visualise(self, dictionary=None)
Visualise input.
source code
 
_get_observation(self)
method to generate observation - current state, finish states
source code
 
_get_action_space(self)
method to get action space - all available actions in enviroment
source code
 
__get_reward_curr_state(self) source code
 
_get_reward(self, curr, last)
returns reward and indication of goal state
source code
 
_get_depth(self, state)
Get depth (z coordinate) of state based on gradient.
source code
Class Variables [hide private]
  metadata = {'render.modes': ['human']}
  _path = []
  _visited = []
  MAP = '../maps/easy/easy3.bmp'
Method Details [hide private]

__init__(self, informed, gym_compatible, deter, map_image_dir=None, grad=(0,0), node_rewards=None)
(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`

save_path(self)

source code 

Method for saving path of the agent into the file named 'saved_path.txt' into the directory where was the script runned from.

Returns:
None

save_eps(self)

source code 

Save last rendered image into directory where the script was runned from.

Returns:
None

visualise(self, dictionary=None)

source code 

Visualise input. If visualise is called before GUI opening, render() is called first

Parameters:
  • dictionary - input to visualise, can be None -> visulise depth, or dictionary: {'x': x_coord, 'y': y_coord, 'value': value_to_visualise} where value can be scalar or 4 dimensional vector (tuple or list).
Returns:
none

_get_observation(self)

source code 

method to generate observation - current state, finish states

Returns:
tuple

_get_action_space(self)

source code 

method to get action space - all available actions in enviroment

Returns:
spaces

_get_reward(self, curr, last)

source code 

returns reward and indication of goal state

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

_get_depth(self, state)

source code 

Get depth (z coordinate) of state based on gradient. Start state of map has depth 0.

Parameters:
  • state - namedtuple state
Returns:
float