in agent.py [0:0]
def validate_env(env):
"""Check that the MineRL environment is setup correctly, and raise if not"""
for key, value in ENV_KWARGS.items():
if key == "frameskip":
continue
if getattr(env.task, key) != value:
raise ValueError(f"MineRL environment setting {key} does not match {value}")
action_names = set(env.action_space.spaces.keys())
if action_names != set(TARGET_ACTION_SPACE.keys()):
raise ValueError(f"MineRL action space does match. Expected actions {set(TARGET_ACTION_SPACE.keys())}")
for ac_space_name, ac_space_space in TARGET_ACTION_SPACE.items():
if env.action_space.spaces[ac_space_name] != ac_space_space:
raise ValueError(f"MineRL action space setting {ac_space_name} does not match {ac_space_space}")