src.plangym.videogames.montezuma#
Implementation of the montezuma environment adapted for planning problems.
Attributes#
Classes#
Contains the information of Panama Joe. |
|
MontezumaEnv environment that tracks the room and position of Panama Joe. |
|
Plangym implementation of the MontezumaEnv environment optimized for planning. |
Module Contents#
- class src.plangym.videogames.montezuma.MontezumaPosLevel(level, score, room, x, y)[source]#
Contains the information of Panama Joe.
- __slots__ = ['level', 'room', 'score', 'tuple', 'x', 'y']#
- level#
- score#
- room#
- x#
- y#
- tuple = None#
- src.plangym.videogames.montezuma.PYRAMID#
- src.plangym.videogames.montezuma.OBJECT_PIXELS = [50, 40, 40, 40, 37, 37, 42]#
- src.plangym.videogames.montezuma.KNOWN_XY: list[None | tuple[int, int]]#
- src.plangym.videogames.montezuma.KEY_BITS#
- class src.plangym.videogames.montezuma.CustomMontezuma(check_death=True, obs_type='rgb', score_objects=False, objects_from_pixels=False, objects_remember_rooms=False, only_keys=False, death_room_8=True, render_mode='rgb_array', x_repeat=1)[source]#
MontezumaEnv environment that tracks the room and position of Panama Joe.
- Parameters:
check_death (bool)
obs_type (str)
score_objects (bool)
objects_from_pixels (bool)
objects_remember_rooms (bool)
only_keys (bool)
death_room_8 (bool)
render_mode (str)
x_repeat (int)
- render_mode#
- score_objects#
- check_death#
- objects_from_pixels#
- objects_remember_rooms#
- only_keys#
- coords_obs#
- _x_repeat#
- _death_room_8#
- env#
- ram = None#
- cur_steps = 0#
- cur_score = 0#
- rooms#
- cur_lives = 5#
- pos#
- static get_room_xy(room)[source]#
Get the tuple that encodes the provided room.
- Parameters:
room (int)
- Return type:
None | tuple[int, int]
- reset(seed=None, return_info=False)[source]#
Reset the environment.
- Parameters:
return_info (bool)
- Return type:
tuple[numpy.ndarray, dict[str, Any]]
- step(action)[source]#
Step the environment.
- Return type:
tuple[numpy.ndarray, SupportsFloat, bool, bool, dict[str, Any]] | tuple[Any, SupportsFloat, bool, bool, dict[str, Any]]
- pos_from_obs(face_pixels, obs)[source]#
Extract the information of the position of Panama Joe.
- Return type:
- get_objects_from_pixels(obs, room, old_objects)[source]#
Extract the position of the objects in the provided observation.
- get_coords()[source]#
Return an observation containing the position and the flattened screen of the game.
- Return type:
numpy.ndarray
- state_to_numpy()[source]#
Return a numpy array containing the current state of the game.
- Return type:
numpy.ndarray
- get_restore()[source]#
Return a tuple containing all the information needed to clone the state of the env.
- Return type:
tuple
- is_transition_screen(obs)[source]#
Return True if the current observation corresponds to a transition between rooms.
- Return type:
bool
- is_pixel_death(obs, face_pixels)[source]#
Return a death signal extracted from the observation of the environment.
- class src.plangym.videogames.montezuma.MontezumaEnv(name='PlanMontezuma-v0', frameskip=1, episodic_life=False, autoreset=True, delay_setup=False, remove_time_limit=True, obs_type='rgb', mode=0, difficulty=0, repeat_action_probability=0.0, full_action_space=False, render_mode=None, possible_to_win=True, wrappers=None, array_state=True, clone_seeds=True, **kwargs)[source]#
Bases:
plangym.videogames.atari.AtariEnvPlangym implementation of the MontezumaEnv environment optimized for planning.
- Parameters:
frameskip (int)
episodic_life (bool)
autoreset (bool)
delay_setup (bool)
remove_time_limit (bool)
obs_type (str)
mode (int)
difficulty (int)
repeat_action_probability (float)
full_action_space (bool)
render_mode (str | None)
possible_to_win (bool)
wrappers (Iterable[plangym.core.wrap_callable] | None)
array_state (bool)
clone_seeds (bool)
- AVAILABLE_OBS_TYPES#
- _get_default_obs_type(name, obs_type)[source]#
Return the observation type of the internal Atari gym environment.
- Return type:
str
- init_gym_env()[source]#
Initialize the
gum.Env`instance that the current clas is wrapping.- Return type: