ALEx v0.3.2 Alex View Source

(A)rcade (L)earning (E)nvironment for Eli(x)ir.

ALEx is an interface for the ALE in Elixir. There are two ways to interact with the ALE from ALEx: through the Alex.Interface module which mimics the ALE C Lib and provides NIFs for interacting directly with the ALE C++ Interface, or through the Alex module which is a safer wrapper of Alex.Interface.

Alex allows you to interact with the ALE without worrying about some of the lower level details of the ALE Interface. Every function in Alex returns an Alex.Interface struct which contains details about the current ALE Interface. See Alex.Interface for information about the Interface struct.

Link to this section Summary

Functions

Checks if game is over.

Loads the specified ROM and populates fields in %Interface{}.

Initializes a new ALE Interface.

Resets the interface to beginning of an episode.

Takes a screenshot.

Sets option for provided interface.

Sets interface to given state.

Performs a step with provided action and updates the interface.

Link to this section Functions

Checks if game is over.

Returns boolean.

Parameters

  • interface: %Interface{}.
Link to this function

load(interface, path_to_rom)

View Source

Loads the specified ROM and populates fields in %Interface{}.

Returns %Interface{}.

Parameters

  • interface: %Interface{}.

Initializes a new ALE Interface.

Returns %Interface{}.

Parameters

Options

  • :display_screen: true or false to display screen. Defaults to false.
  • :sound: true or false to play sound. Defaults to false.
  • :random_seed: Integer random seed.

Resets the interface to beginning of an episode.

Returns %Interface{}.

Parameters

  • interface: %Interface{}.
Link to this function

screenshot(interface, path \\ "")

View Source

Takes a screenshot.

Returns :ok.

Parameters

  • interface: %Interface{}.
Link to this function

set_option(interface, key, val)

View Source

Sets option for provided interface.

Returns %Interface{}.

Parameters

Options

  • :repeat_action_probability: Float probability that agent will repeat action in next frame regardless of it's choice. Defaults to 0.
  • :color_averaging: true or false to enable color averaging. Defaults to false.
  • :max_num_frames: Integer maximum frames to run. Defaults to 0 or no max.
  • :max_num_frames_per_episode: maximum frames to run per episode. Defaults to 0 or no max.
  • :frame_skip: Integer frame skipping rate. Defaults to 1 or no skip.
  • :difficulty: Integer game difficulty. Defaults to 0.
  • :mode: Integer game mode. Defaults to 0.
Link to this function

set_state(interface, state)

View Source

Sets interface to given state.

Returns %Interface{}.

Parameters

  • interface: %Interface{}.

Performs a step with provided action and updates the interface.

Returns %Interface.

Parameters

  • interface: %Interface{}.
  • action: Integer valid action.