-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.py
64 lines (54 loc) · 1.38 KB
/
data.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
54
55
56
57
58
59
60
61
62
63
64
from sys import argv
if len(argv) != 2:
exit()
trials = int(argv[1])
pure = []
random = []
hill = []
annealing = []
pp_random = []
pp_hill = []
pp_annealing = []
with open('raw.txt', 'r') as f:
for i in range(trials):
pure.append(f.readline())
for i in range(trials):
random.append(f.readline())
for i in range(trials):
hill.append(f.readline())
for i in range(trials):
annealing.append(f.readline())
for i in range(trials):
pp_random.append(f.readline())
for i in range(trials):
pp_hill.append(f.readline())
for i in range(trials):
pp_annealing.append(f.readline())
pure_file = open('pure.txt', 'w')
for i in pure:
pure_file.write(i)
pure_file.close()
random_file = open('random.txt', 'w')
for i in random:
random_file.write(i)
random_file.close()
hill_file = open('hill.txt', 'w')
for i in hill:
hill_file.write(i)
hill_file.close()
annealing_file = open('annealing.txt', 'w')
for i in annealing:
annealing_file.write(i)
annealing_file.close()
pp_random_file = open('pp_random.txt', 'w')
for i in pp_random:
pp_random_file.write(i)
pp_random_file.close()
pp_hill_file = open('pp_hill.txt', 'w')
for i in pp_hill:
pp_hill_file.write(i)
pp_hill_file.close()
pp_annealing_file = open('pp_annealing.txt', 'w')
for i in pp_annealing:
pp_annealing_file.write(i)
pp_annealing_file.close()