April 2019
Intermediate to advanced
212 pages
5h 34m
English
We can take a random action using env.action_space.sample(), as follows:
observation, reward, done, info = env.step(env.action_space.sample())
The env.action_space.sample() function returns a random action from the allowed actions. The env.step() function carries out this action and sends us to the next state.
Recall the four variables that we have collected from env.step():
Read now
Unlock full access