Let's start with the recipe:
- The core interface provided by OpenAI Gym is the Unified Environment Interface. The agent can interact with the environment using three basic methods, that is, reset, step, and render. The reset method resets the environment and returns the observation. The step method steps the environment by one timestep and returns observation, reward, done, and info. The render method renders one frame of the environment, like popping a window.
- To use OpenAI Gym, you will need to import it first:
import gym
- Next, we create our first environment:
env_name = 'Breakout-v3'env = gym.make(env_name)
- We start the environment using the reset method:
obs = env.reset()
- Let's check the shape of our environment: ...