OpenAI Gym API and Gymnasium
After talking so much about the theoretical concepts of reinforcement learning (RL) in Chapter 1, let’s start doing something practical. In this chapter, you will learn the basics of Gymnasium, a library used to provide a uniform API for an RL agent and lots of RL environments. Originally, this API was implemented in the OpenAI Gym library, but it is no longer maintained. In this book, we’ll use Gymnasium—a fork of OpenAI Gym implementing the same API. In any case, having a uniform API for environments removes the need to write boilerplate code and allows you to implement an agent in a general way without worrying about environment details.
You will also write your first randomly behaving agent and become more familiar with the basic concepts of RL that we have covered so far. By the end of the chapter, you will have an understanding of:
-
The high-level requirements that need to be implemented...