src.plangym.control.lunar_lander#

Implementation of LunarLander with no fire coming out of the engines that steps faster.

Attributes#

Classes#

FastGymLunarLander

Faster implementation of the LunarLander without bells and whistles.

LunarLander

Fast LunarLander that follows the plangym API.

Module Contents#

src.plangym.control.lunar_lander.import_error = None#
src.plangym.control.lunar_lander.FPS = 50#
src.plangym.control.lunar_lander.SCALE = 30.0#
src.plangym.control.lunar_lander.MAIN_ENGINE_POWER = 13.0#
src.plangym.control.lunar_lander.SIDE_ENGINE_POWER = 0.6#
src.plangym.control.lunar_lander.INITIAL_RANDOM = 1000.0#
src.plangym.control.lunar_lander.LANDER_POLY#
src.plangym.control.lunar_lander.LEG_AWAY = 20#
src.plangym.control.lunar_lander.LEG_DOWN = 18#
src.plangym.control.lunar_lander.LEG_SPRING_TORQUE = 40#
src.plangym.control.lunar_lander.SIDE_ENGINE_HEIGHT = 14.0#
src.plangym.control.lunar_lander.SIDE_ENGINE_AWAY = 12.0#
src.plangym.control.lunar_lander.VIEWPORT_W = 600#
src.plangym.control.lunar_lander.VIEWPORT_H = 400#
class src.plangym.control.lunar_lander.FastGymLunarLander(deterministic=False, continuous=False)[source]#

Bases: gymnasium.envs.box2d.lunar_lander.LunarLander

Faster implementation of the LunarLander without bells and whistles.

Parameters:
  • deterministic (bool)

  • continuous (bool)

FPS#
deterministic#
game_over = False#
prev_shaping = None#
helipad_x1 = None#
helipad_x2 = None#
helipad_y = None#
moon = None#
sky_polys = None#
lander = None#
legs = None#
drawlist = None#
viewer = None#
particles = None#
prev_reward = None#
observation_space = None#
action_space = None#
continuous#
_display = None#
__del__()[source]#

Close the environment.

reset()[source]#

Reset the environment to its initial state.

Return type:

tuple

step(action)[source]#

Step the environment applying the provided action.

Parameters:

action (int)

Return type:

tuple

render(mode=None)[source]#

Render the environment.

class src.plangym.control.lunar_lander.LunarLander(name=None, frameskip=1, episodic_life=True, autoreset=True, wrappers=None, delay_setup=False, deterministic=False, continuous=False, render_mode='rgb_array', remove_time_limit=None, **kwargs)[source]#

Bases: plangym.core.PlangymEnv

Fast LunarLander that follows the plangym API.

Parameters:
  • name (str | None)

  • frameskip (int)

  • episodic_life (bool)

  • autoreset (bool)

  • wrappers (Iterable[plangym.core.wrap_callable] | None)

  • delay_setup (bool)

  • deterministic (bool)

  • continuous (bool)

  • render_mode (str | None)

_deterministic#
_continuous#
property deterministic: bool#

Return true if the LunarLander simulation is deterministic.

Return type:

bool

property continuous: bool#

Return true if the LunarLander agent takes continuous actions as input.

Return type:

bool

init_gym_env()[source]#

Initialize the target gym.Env instance.

Return type:

FastGymLunarLander

get_state()[source]#

Recover the internal state of the simulation.

An state must completely describe the Environment at a given moment.

Return type:

numpy.ndarray

set_state(state)[source]#

Set the internal state of the simulation.

Parameters:

state (numpy.ndarray) – Target state to be set in the environment.

Returns:

None

Return type:

None

get_image()[source]#

Return a numpy array containing the rendered view of the environment.

Square matrices are interpreted as a greyscale image. Three-dimensional arrays are interpreted as RGB images with channels (Height, Width, RGB).

Return type:

numpy.ndarray

process_terminal(terminal, obs=None, **kwargs)[source]#

Return the terminal condition considering the lunar lander state.

Return type:

bool