官术网_书友最值得收藏!

Simulating the FrozenLake environment

The optimal policies for the MDPs we have dealt with so far are pretty intuitive. However, it won't be that straightforward in most cases, such as the FrozenLake environment. In this recipe, let's play around with the FrozenLake environment and get ready for upcoming recipes where we will find its optimal policy.

FrozenLake is a typical Gym environment with a discrete state space. It is about moving an agent from the starting location to the goal location in a grid world, and at the same time avoiding traps. The grid is either four by four (https://gym.openai.com/envs/FrozenLake-v0/) or eight by eigh.

t (https://gym.openai.com/envs/FrozenLake8x8-v0/). The grid is made up of the following four types of tiles:

  • S: The starting location
  • G: The goal location, which terminates an episode
  • F: The frozen tile, which is a walkable location
  • H: The hole location, which terminates an episode

There are four actions, obviously: moving left (0), moving down (1), moving right (2), and moving up (3). The reward is +1 if the agent successfully reaches the goal location, and 0 otherwise. Also, the observation space is represented in a 16-dimensional integer array, and there are 4 possible actions (which makes sense). 

What is tricky in this environment is that, as the ice surface is slippery, the agent won't always move in the direction it intends. For example, it may move to the left or to the right when it intends to move down.

主站蜘蛛池模板: 秦皇岛市| 襄城县| 韶关市| 大石桥市| 枣庄市| 阳东县| 长武县| 镇坪县| 盐城市| 耿马| 临朐县| 江源县| 射阳县| 兴海县| 福贡县| 上饶县| 太和县| 遂昌县| 镇宁| 三穗县| 阳谷县| 连平县| 梁平县| 江孜县| 台北县| 页游| 荥阳市| 惠水县| 新绛县| 潜山县| 星座| 宽城| 时尚| 庆城县| 拜城县| 上林县| 新丰县| 如皋市| 闵行区| 灯塔市| 绥阳县|