hyphi_gym.common.grid
#
Module Contents#
Classes#
Base for grid-based games managing |
- class hyphi_gym.common.grid.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