plangym.videogames.montezuma
Implementation of the montezuma environment adapted for planning problems.
Module Contents
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. |
Attributes
- class plangym.videogames.montezuma.MontezumaPosLevel(level, score, room, x, y)[source]
Contains the information of Panama Joe.
- __slots__ = ['level', 'score', 'room', 'x', 'y', 'tuple']
- plangym.videogames.montezuma.PYRAMID = [None, None, None, [15, 16, 17, 18, 19, 20, 21, 22, 23]]
- plangym.videogames.montezuma.OBJECT_PIXELS = [50, 40, 40, 40, 37, 37, 42]
- plangym.videogames.montezuma.KNOWN_XY
- plangym.videogames.montezuma.KEY_BITS
- class 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)[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) –
- reset(self, seed=None, return_info=False)[source]
Reset the environment.
- Parameters
return_info (bool) –
- Return type
numpy.ndarray
- step(self, action)[source]
Step the environment.
- Return type
Tuple[numpy.ndarray, float, bool, dict]
- pos_from_obs(self, face_pixels, obs)[source]
Extract the information of the position of Panama Joe.
- Return type
- get_objects_from_pixels(self, obs, room, old_objects)[source]
Extract the position of the objects in the provided observation.
- get_coords(self)[source]
Return an observation containing the position and the flattened screen of the game.
- Return type
numpy.ndarray
- state_to_numpy(self)[source]
Return a numpy array containing the current state of the game.
- Return type
numpy.ndarray
- _restore_state(self, state)[source]
Restore the state of the game from the provided numpy array.
- Return type
None
- get_restore(self)[source]
Return a tuple containing all the information needed to clone the state of the env.
- Return type
tuple
- is_transition_screen(self, obs)[source]
Return True if the current observation corresponds to a transition between rooms.
- Return type
bool
- get_face_pixels(self, obs)[source]
Return the pixels containing the face of Paname Joe.
- Return type
set
- is_pixel_death(self, obs, face_pixels)[source]
Return a death signal extracted from the observation of the environment.
- is_ram_death(self)[source]
Return a death signal extracted from the ram of the environment.
- Return type
bool
- static get_room_xy(room)[source]
Get the tuple that encodes the provided room.
- Return type
Tuple[Union[None, Tuple[int, int]]]
- static get_room_out_of_bounds(room_x, room_y)[source]
Return a boolean indicating if the provided tuple represents and invalid room.
- Return type
bool
- static get_room_from_xy(room_x, room_y)[source]
Return the number of the room from a tuple.
- Return type
int
- class 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.AtariEnv
Plangym 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 (Optional[str]) –
possible_to_win (bool) –
wrappers (Iterable[plangym.core.wrap_callable]) –
array_state (bool) –
clone_seeds (bool) –
- AVAILABLE_OBS_TYPES
- _get_default_obs_type(self, name, obs_type)[source]
Return the observation type of the internal Atari gym environment.
- Return type
str
- init_gym_env(self)[source]
Initialize the
gum.Env`
instance that the current clas is wrapping.- Return type