-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (28 loc) · 802 Bytes
/
main.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
from nav2d.envs.envs import CellMapMultiNav
from time import sleep
if __name__ == '__main__':
seed = 20240723
env = CellMapMultiNav(
train_init_cells=[(0, 1), (1, 0), (1, 1)],
eval_init_cells=[(0, 0)],
goal_cells=[(9, 0), (9, 9), (0, 9)],
num_blocks=5,
num_dynamics=5,
v_max=1.,
map_seed=seed,
seed=seed,
sparse=True,
)
env.reset()
env.render()
env.action_space.seed(seed)
while True:
action = env.action_space.sample()
obs, reward, done, info = env.step(action)
print(f"Obs: {obs}, Action: {action}, Reward: {reward}, Done: {done}, Info: {info}")
env.render()
sleep(.1)
if done:
env.reset()
env.render()
sleep(1)