forked from facebookresearch/hsd3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enumEnv.py
41 lines (36 loc) · 1008 Bytes
/
enumEnv.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import gym
import hucc
def test_envs():
envs = [
"BiskHurdles-v1",
"BiskLimbo-v1",
"BiskHurdlesLimbo-v1",
"BiskStairs-v1",
"BiskGaps-v1",
]
cfg = {
"env": {
"name": "Dummy",
"train_procs": 1,
"train_args": {},
},
"device": "cpu",
"seed": 0,
}
for env_name in envs:
cfg["env"]["name"] = env_name
try:
vec_envs = hucc.make_vec_envs(
cfg["env"]["name"],
cfg["env"]["train_procs"],
device=cfg["device"],
seed=cfg["seed"],
**cfg["env"]["train_args"],
)
print(f"Successfully created {env_name}")
except gym.error.UnregisteredEnv:
print(f"Environment {env_name} is not registered.")
except Exception as e:
print(f"Error occurred while creating {env_name}: {str(e)}")
if __name__ == "__main__":
test_envs()