GymActionConversion

class maze.core.wrappers.maze_gym_env_wrapper.GymActionConversion(env: gymnasium.Env)

A dummy conversion interface asserting that the action is packed into a dictionary space.

Parameters:

env – Gymnasium environment.

create_action_hash(action: Any) int | str

An integer representation of the action.

static inv_action_hash(action_hash: int) Any

Revert a unique, deterministic int hash to the given maze action.

Parameters:

action_hash – The action created with the self.create_action_hash method.

Returns:

The action.

maze_to_space(maze_action: Any) Dict[str, numpy.ndarray]

(overrides ActionConversionInterface)

Converts environment MazeAction to agent action.

param maze_action:

the environment MazeAction.

return:

the agent action.

space() gymnasium.spaces.Dict

(overrides ActionConversionInterface)

Returns respective gym action space.

space_to_maze(action: Dict[str, numpy.ndarray], maze_state: Any) Any

(overrides ActionConversionInterface)

Converts agent action to environment MazeAction.

param action:

the agent action.

param maze_state:

the environment state.

return:

the environment MazeAction.