Understanding the anatomy of Gym environments
Any Gym-compatible environment should subclass the gym.Env
class and implement the reset
and step
methods and the observation_space
and action_space
properties and attributes. There is also the opportunity to implement other, optional methods that can add additional functionality to our custom environments. The following table lists and describes the other methods available:
Method | Functionality description |
| The shape and type of the observations returned by the environment. |
| The shape and type of the actions accepted by the environment. |
| Routines to reset the environment at the start or end of an episode. |
| Routines that calculate the necessary information to advance the environment, simulation, or game to the next step. The routine includes applying the chosen action in the environment, calculating the reward, producing the next observation, and determining if an episode has ended. |
| (Optional) This... |