-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (35 loc) · 897 Bytes
/
Copy pathmain.py
File metadata and controls
40 lines (35 loc) · 897 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
38
39
40
from world import *
user = User(move='v3')
level = 4
world = World(user=user, level=level)
# train
score_list = []
for episode in range(TOTAL_EPISODE):
world.reset()
while True:
done = world.move(test=False)
if done:
break
print('EPI : %d / %d' % (episode + 1, TOTAL_EPISODE), end='\r', flush=True)
# test
if (episode + 1) % TEST_STEP == 0:
world.reset()
while True:
done = world.move(test=True)
if done:
break
score_list.append(world.total_score)
print()
plt.bar(range(len(score_list)), score_list, color='blue')
plt.show()
# test
world.reset()
while True:
world.show()
input('...')
done = world.move(test=True)
if done:
break
print('========== Finish ==========')
print('Total score : %d' % world.total_score)
print('Total time : %d' % world.total_time)