hyphi_gym.envs.GridMaze
#
Package Contents#
Classes#
Base for grid-based games managing |
|
Gridworld Maze Environment based on hyphi Grid. |
|
Gridworld Maze Environment based on hyphi Grid. |
- class hyphi_gym.envs.GridMaze.Grid(render_mode: hyphi_gym.common.board.Optional[str] = None, **simargs)#
Bases:
hyphi_gym.common.rendering.Rendering
,hyphi_gym.common.point.Point
Base for grid-based games managing • A layout of a variable size • Containing CELLS ∈ [WALL, FIELD, AGENT, TARGET, HOLE] • Navigable with ACTIONS ∈ [UP, RIGHT, DOWN,LEFT]
- step_scale = 1#
- base_xml#
- metadata#
- render() hyphi_gym.common.board.Optional[hyphi_gym.common.board.np.ndarray] #
Return rendering of current state as np array if render_mode set
- reset(**kwargs) tuple[hyphi_gym.common.board.np.ndarray, dict] #
Gymnasium compliant function to reset the environment
- _distance()#
- execute(action: int) tuple[hyphi_gym.common.board.np.ndarray, dict] #
Helper function to step the environment, executing action, returning its consequences
- class hyphi_gym.envs.GridMaze.Maze(size, random=[], prefix='', **kwargs)#
Bases:
hyphi_gym.common.board.Board
Gridworld Maze Environment based on hyphi Grid. :param size: (≤15, guarantee solvability within 100 steps (worst for 15: 96)) :param random: optional list of features to be stochastic supporting layout, agent-, and target-placement
- _generate()#
Generate random mazes of self.size using Kruskal’s algorithm. Generated mazes are forced to difer the static configurations above.
- class hyphi_gym.envs.GridMaze.GridMaze(render_mode=None, **kwargs)#
Bases:
hyphi_gym.common.maze.Maze
,hyphi_gym.common.grid.Grid
Gridworld Maze Environment based on hyphi Grid. :param size: (≤15, guarantee solvability within 100 steps (worst for 15: 96)) :param random: optional list of features to be stochastic supporting layout, agent-, and target-placement