April 2019
Intermediate to advanced
212 pages
5h 34m
English
We get the number of states and actions from the environment with the following two variables:
env.observation_spaceenv.action_space
As mentioned previously, we will usually use the term state to follow convention, but the environment variable will be called an observation. These terms can be treated as interchangeable in this context, as shown in the following screenshot:

Both the Action Space and the State Space attributes referenced in the preceding screenshot are of type gym.spaces.discrete.Discrete. You can find out more information about these attribute types from the official Gym documentation.
Read now
Unlock full access