ActionConversionInterface

class maze.core.env.action_conversion.ActionConversionInterface

Interface specifying the conversion of agent actions to actual environment MazeActions.

create_action_hash(action: Dict[str, Union[int, numpy.ndarray]]) → Union[int, str]

Calculate a hash of the given action. Can be used for identifying and de-duplicating same actions when creating/evaluating action scenarios.

Parameters

action – Action to hash

Returns

Hash of a given action, either as a string, or integer (should be of the same type for all actions)

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

Converts environment MazeAction to agent action.

Parameters

maze_action – the environment MazeAction.

Returns

the agent action.

noop_action()

Converts environment MazeAction to agent action.

Returns

the noop action.

abstract space() → gym.spaces.Dict

Returns respective gym action space.

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

Converts agent action to environment MazeAction.

Parameters
  • action – the agent action.

  • maze_state – the environment state.

Returns

the environment MazeAction.