-
Notifications
You must be signed in to change notification settings - Fork 2
/
envs.py
75 lines (71 loc) · 3.17 KB
/
envs.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from gridenvs.examples.key_door import KeyDoorEnv
from gym import register
def mazeXL(**kwargs):
init_map = ["WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW",
"W......W......W........W.......W",
"W......W......W........W.......W",
"W......W......W........W.......W",
"W..............................W",
"W......H...................D...W",
"W.............W................W",
"W.............W........W.......W",
"WWW...WWW...WWWWWWWWWWWW......WW",
"W.............W................W",
"W.............W................W",
"W.............W................W",
"W.............W................W",
"W.............W................W",
"W.............W................W",
"WWWWWWWWWW...WWWWWWWWWWW...WWWWW",
"W.................W............W",
"W.................W............W",
"W..............................W",
"W......W.......................W",
"W......W.......................W",
"W......W..........W............W",
"W......W......WWWWWWW...WWWWWWWW",
"W......W......W................W",
"WWW...WWW...WWW................W",
"W.............W................W",
"W.............W........K.......W",
"W..............................W",
"W..............................W",
"W.............W................W",
"W.............W................W",
"WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW"]
return KeyDoorEnv(init_map, **kwargs)
def mazeL(**kwargs):
init_map = ["WWWWWWWWWWWWWWWWWWWW",
"W..................W",
"W....H.........D...W",
"W........W.........W",
"W........W.........W",
"WWW....WWWWW......WW",
"W........W.........W",
"W........W.........W",
"W........W.........W",
"W........W.........W",
"W........W.........W",
"W........W.........W",
"WWWWW...WWWW...WWWWW",
"W........W.........W",
"W........W.........W",
"W............K.....W",
"W..................W",
"W........W.........W",
"W........W.........W",
"WWWWWWWWWWWWWWWWWWWW"]
return KeyDoorEnv(init_map, **kwargs)
for s in ["L", "XL"]:
max_moves = 500 if s=="L" else 1000
for r in [True, False]:
register(id='GE_MKD%s-v%i'%(s, int(r)),
entry_point='envs:maze%s'%s,
kwargs={'max_moves': max_moves, "key_reward": r},
nondeterministic=False)
for s in ["L", "XL"]:
for max_moves in [100, 200, 300, 400, 500, 1000]:
register(id='GE_MKD%s%i-v0'%(s, max_moves),
entry_point='envs:maze%s'%s,
kwargs={'max_moves': max_moves, "key_reward": False},
nondeterministic=False)