Search code examples
reinforcement-learningopenai-gym

In OpenAI gym environments the initial state is random or specific?


Is the initial state randomly selected in reinforcement learning environments like OpenAI gym. In other words, does command env.reset() result in randomly selected initial state or specific initial state?


Solution

  • Usually yes, it is random. However, it is better that you look at the source code of the environment to be sure. For instance, the pendulum initial state is uniformly drawn from the whole state space, while for the mountain car the state position is uniformly drawn from [-0.6, -0.4] and the velocity is always 0.