Spaces:
Sleeping

File size: 376 Bytes
bc5aa4d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from env import GeoEnv
from models import Action

env = GeoEnv()

obs = env.reset()
print("start:", obs)

actions = ["up", "down", "left", "right"]

for step in range(10):
    action = Action(move=actions[step % 4])

    obs, reward, done = env.step(action)

    print(f"step {step}: {obs.position}, reward={reward}")

    if done:
        print("reached goal!")
        break