Frozen Lake#

../../../_images/frozen_lake.gif

This environment is part of the Toy Text environments. Please read that page first for general information.

Action Space

Discrete(4)

Observation Space

Discrete(16)

Import

gym.make("FrozenLake-v1")

Frozen lake involves crossing a frozen lake from Start(S) to Goal(G) without falling into any Holes(H) by walking over the Frozen(F) lake. The agent may not always move in the intended direction due to the slippery nature of the frozen lake.

Action Space#

The agent takes a 1-element vector for actions. The action space is (dir), where dir decides direction to move in which can be:

  • 0: LEFT

  • 1: DOWN

  • 2: RIGHT

  • 3: UP

Observation Space#

The observation is a value representing the agent’s current position as current_row * nrows + current_col (where both the row and col start at 0). For example, the goal position in the 4x4 map can be calculated as follows: 3 * 4 + 3 = 15. The number of possible observations is dependent on the size of the map. For example, the 4x4 map has 16 possible observations.

Rewards#

Reward schedule:

  • Reach goal(G): +1

  • Reach hole(H): 0

  • Reach frozen(F): 0

Arguments#

gym.make('FrozenLake-v1', desc=None,map_name="4x4", is_slippery=True)

desc: Used to specify custom map for frozen lake. For example,

desc=["SFFF", "FHFH", "FFFH", "HFFG"].

map_name: ID to use any of the preloaded maps.

"4x4":[
    "SFFF",
    "FHFH",
    "FFFH",
    "HFFG"
    ]

"8x8": [
    "SFFFFFFF",
    "FFFFFFFF",
    "FFFHFFFF",
    "FFFFFHFF",
    "FFFHFFFF",
    "FHHFFFHF",
    "FHFFHFHF",
    "FFFHFFFG",
]

is_slippery: True/False. If True will move in intended direction with probability of 1/3 else will move in either perpendicular direction with equal probability of 1/3 in both directions.

For example, if action is left and is_slippery is True, then:
- P(move left)=1/3
- P(move up)=1/3
- P(move down)=1/3

Version History#

  • v1: Bug fixes to rewards

  • v0: Initial versions release (1.0.0)