Better error when called on non-discrete action spaces

This commit is contained in:
Trevor Blackwell
2017-02-27 10:00:58 -08:00
parent 8c6468b34d
commit 874b6fe2af

View File

@@ -9,6 +9,8 @@ import sys, gym
env = gym.make('LunarLander-v2' if len(sys.argv)<2 else sys.argv[1])
if not hasattr(env.action_space, 'n'):
raise Exception('Keyboard agent only supports discrete action spaces')
ACTIONS = env.action_space.n
ROLLOUT_TIME = 1000
SKIP_CONTROL = 0 # Use previous control decision SKIP_CONTROL times, that's how you