Gridworld environment for reinforcement learning from Sutton & Barto (2017). Grid of shape 4x12 with a goal state in the bottom right of the grid. Episodes start in the lower left state. Possible actions include going left, right, up and down. Some states in the lower part of the grid are a cliff, so taking a step into this cliff will yield a high negative reward of - 100 and move the agent back to the starting state. Elsewise rewards are - 1, for the goal state 0.

Arguments

...

[any] Arguments passed on to makeEnvironment.

Details

This is the gridworld (goal state denoted G, cliff states denoted C, start state denoted S):

. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
S C C C C C C C C C C G

Usage

makeEnvironment("cliff.walking", ...)

Methods

  • $step(action) Take action in environment. Returns a list with state, reward, done.

  • $reset() Resets the done flag of the environment and returns an initial state. Useful when starting a new episode.

  • $visualize() Visualizes the environment (if there is a visualization function).

References

Sutton and Barto (Book draft 2017): Reinforcement Learning: An Introduction Example 6.6

Examples

env = makeEnvironment("cliff.walking")