1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

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

This commit is contained in:
Zach Dwiel
2019-01-13 04:06:48 -05:00
committed by Gal Leibovich
parent 053adf0ca9
commit 0ccc333d77

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