Struct relearn::envs::MemoryGame[][src]

pub struct MemoryGame {
    pub num_actions: usize,
    pub history_len: usize,
}
Expand description

Memory Game Environment

The agent must remember the inital state and choose the corresponding action as the final action in an episode.

  • The environment consists of (NUM_ACTIONS + HISTORY_LEN) states.
  • An episode starts in a state [0, NUM_ACTIONS) uniformly at random.
  • Step i in [0, HISTORY_LEN) transitions to state NUM_ACTIONS + i with 0 reward regardless of the action.
  • On step HISTORY_LEN, the agent chooses one of NUM_ACTIONS actions and if the action index matches the index of the inital state then the agent earns +1 reward, otherwise it earns -1 reward. This step is terminal.
  • Every episode has length HISTORY_LEN + 1.

Fields

num_actions: usize

The number of actions.

history_len: usize

Length of remembered history required to solve the environment.

Implementations

Create a new MemoryGame instance

Args
  • num_actions - Number of possible actions.
  • history_len - Length of remembered history required to solve the environment.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Space containing all possible observations. Read more

The space of all possible actions. Read more

A lower and upper bound on possible reward values. Read more

A discount factor applied to future rewards. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

(current_state, initial_state)

Sample a new initial state.

Sample an observation for a state.

Sample a state transition. Read more

Update in-place from the given source value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Apply an update from the given source value.