They recently added the capability of generating a random frozen map. But there is no accompanying documentation of how to use it. I want to use it in an ongoing project.
One option is to use the function generate_random_map() from the frozen_lake module and use the map returned by the function as an argument to the desc parameter when creating the environment:
import gym
from gym.envs.toy_text.frozen_lake import generate_random_map
random_map = generate_random_map(size=20, p=0.8)
env = gym.make("FrozenLake-v0", desc=random_map)
env.reset()
env.render()
the generate_random_map() function takes two parameters:
Another option is to create a subclass of the FrozenLake environment that takes the size and p parameters directly and register it as a new environment. You can find an example of this approach on the following repository: