-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_single.py
More file actions
37 lines (32 loc) · 774 Bytes
/
test_single.py
File metadata and controls
37 lines (32 loc) · 774 Bytes
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
import manytor as tor
from tqdm import tqdm
import time
epochs = 300
max_steps = 200
obj_number = 10
env = tor.Environment(obj_number)
obs = env.reset(returnable=True)
epochs_time = []
rendering = False
epoch = 0
timer = time.time()
for i in range(1, epochs):
time_epoch = time.time()
for p in tqdm(range(max_steps)):
action = env.action_sample()
obs2, reward, done = env.step(action)
if done:
break
if not i % 10:
env.render()
elif env.rendering:
env.render(stop_render=True)
epoch += 1
epochs_time.append([i, time.time()-time_epoch])
print('Total Reward: ', env.total_reward)
print('Epoch: ', epoch)
env.reset()
total_time = time.time()-timer
print('Total Time: ', total_time)
print('Time per Epoch: ', epochs_time)
env.render(stop_render=True)