raise value error if there is an invalid action space (#179)

This commit is contained in:
Zach Dwiel
2019-01-13 11:06:48 +02:00
committed by Gal Leibovich
parent 053adf0ca9
commit 0ccc333d77
+5
View File
@@ -379,6 +379,11 @@ class GymEnvironment(Environment):
num_actions=self.env.action_space.n,
descriptions=actions_description
)
else:
raise screen.error((
"Failed to instantiate gym environment class {} due to unsupported "
"action space {}. Expected BoxActionSpace or DiscreteActionSpace."
).format(env_class, self.env.action_space), crash=True)
if self.human_control:
# TODO: add this to the action space