forked from martius-lab/depRL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_scone.py
53 lines (46 loc) · 1.17 KB
/
test_scone.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
import gym
import sconegym # noqa
SEED = 1
def helper_env_loop(env):
returns = []
for ep in range(1):
ret = 0
env.seed(SEED)
obs = env.reset()
for i in range(500):
action = env.action_space.sample()
obs, reward, done, _ = env.step(action)
ret += reward
if done:
break
returns.append(ret)
env.close()
return returns
def test_envs():
for name in [
"sconewalk_h0918-v0",
"sconewalk_h1622-v0",
"sconewalk_h2190-v0",
"sconerun_h0918-v0",
"sconerun_h1622-v0",
"sconerun_h2190-v0",
"sconewalk_h0918-v1",
"sconewalk_h1622-v1",
"sconewalk_h2190-v1",
"sconerun_h0918-v1",
"sconerun_h1622-v1",
"sconerun_h2190-v1",
]:
env = gym.make(name)
env.seed(SEED)
print(f"Testing {name=}")
helper_env_loop(env)
# assert np.floor(returns[0]) == 3511
if __name__ == "__main__":
test_envs()
# test_chasetag_actionrng()
# test_chasetag_obs_rng()
# test_relocate()
# test_rng_noise()
# test_myolegwalk()
# test_relocate()