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
|
observation_space
|
The shape and type of the observations returned by the environment. |
action_space
|
The shape and type of the actions accepted by the environment. |
reset()
|
Routines to reset the environment at the start or end of an episode. |
step(...)
|
Routines that calculate the necessary information to advance the environment, simulation, or game to the next step. The routine includes applying the chosen action... |