MulaiMulai sekarang secara gratis

Exploring state and action spaces

The Cliff Walking environment involves an agent crossing a grid world from start to goal while avoiding falling off a cliff. If the player moves to a cliff location it returns to the start location. The player makes moves until they reach the goal, which ends the episode. Your task is to explore the state and action spaces of this environment.

Image showing an animation for the cliff walking environment.

Latihan ini adalah bagian dari kursus

Reinforcement Learning with Gymnasium in Python

Lihat Kursus

Petunjuk latihan

  • Create an environment instance for Cliff Walking with with the environment ID CliffWalking.
  • Compute the size of the action space and store it in num_actions.
  • Compute the size of the state space and store it in num_states.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create the Cliff Walking environment
env = ____

# Compute the size of the action space
num_actions = ____

# Compute the size of the state space
num_states = ____

print("Number of actions:", num_actions)
print("Number of states:", num_states)
Edit dan Jalankan Kode