-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerge_all.py
79 lines (76 loc) · 3.67 KB
/
merge_all.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import sys
if len(sys.argv) != 11:
print 'Parameter error!'
sys.exit(1)
fout = open('output.html', 'w')
fout.write('<p>Here we compute the Elo ratings of all the gomoku AIs which have ever taken part in gomocup, based on the historical competition results (2000 - present).</p><p>An AI would appear in the best rating list only if it satisfies the following conditions at the same time:</p><ul><li>There exist at least 50 freestyle games, or 100 fastgames, or 20 standard/renju games.</li><li>It has been active in Gomocup in the last five years, or none of its versions has been active in Gomocup during this time period.</li></ul>')
#there exist at least 100 game records for it (This threshold is 50 for freestyle ratings, 100 for fastgame ratings and 20 for standard and renju ratings).</p>\n')
fout.write('\n')
fout.write('<p><strong>The Gomoku Rating:</strong></p>\n')
fout.write('<ul>\n')
fout.write('<li><a href="#elo_1">The Freestyle Rating (Best Versions Only)</a></li>\n')
fout.write('<li><a href="#elo_2">The Fastgame Rating (Best Versions Only)</a></li>\n')
fout.write('<li><a href="#elo_3">The Standard Rating (Best Versions Only)</a></li>\n')
#fout.write('<a href="#elo_4">The General Rating (Best Versions Only)</a></strong>\n')
fout.write('</ul>\n')
fout.write('\n')
fout.write('<ul>\n')
fout.write('<li><a href="#elo_5">The Freestyle Rating (All Versions)</a></li>\n')
fout.write('<li><a href="#elo_6">The Fastgame Rating (All Versions)</a></li>\n')
fout.write('<li><a href="#elo_7">The Standard Rating (All Versions)</a></li>\n')
#fout.write('<a href="#elo_8">The General Rating (All Versions)</a>\n')
fout.write('</ul>\n')
fout.write('\n')
fout.write('<p><strong>The Renju Rating:</strong></p>\n')
fout.write('<ul>\n')
fout.write('<li><a href="#elo_9">The Renju Rating (Best Versions Only)</a></li>\n')
fout.write('<li><a href="#elo_10">The Renju Rating (All Versions)</a></li>\n')
fout.write('</ul>\n')
fout.write('\n')
fout.write('<p><a name="elo_1"></a>The Freestyle Rating:</p>\n')
fin = open(sys.argv[1], 'r')
fout.write(fin.read())
fin.close()
fout.write('<p><a name="elo_2"></a>The Fastgame Rating:</p>\n')
fin = open(sys.argv[2], 'r')
fout.write(fin.read())
fin.close()
fout.write('<p><a name="elo_3"></a>The Standard Rating:</p>\n')
fin = open(sys.argv[3], 'r')
fout.write(fin.read())
fin.close()
'''
fout.write('<a name="elo_4"></a>The General Rating (Freestyle, Fastgame, Standard):\n')
fin = open(sys.argv[4], 'r')
fout.write(fin.read())
fin.close()
'''
fout.write('<p><a name="elo_5"></a>The Complete Freestyle Rating:</p>\n')
fin = open(sys.argv[5], 'r')
fout.write(fin.read())
fin.close()
fout.write('<p><a name="elo_6"></a>The Complete Fastgame Rating:</p>\n')
fin = open(sys.argv[6], 'r')
fout.write(fin.read())
fin.close()
fout.write('<p><a name="elo_7"></a>The Complete Standard Rating:</p>\n')
fin = open(sys.argv[7], 'r')
fout.write(fin.read())
fin.close()
'''
fout.write('<a name="elo_8"></a>The Complete General Rating (Freestyle, Fastgame, Standard):\n')
fin = open(sys.argv[8], 'r')
fout.write(fin.read())
fin.close()
'''
fout.write('<p><a name="elo_9"></a>The Renju Rating:</p>\n')
fin = open(sys.argv[9], 'r')
fout.write(fin.read())
fin.close()
fout.write('<p><a name="elo_10"></a>The Complete Renju Rating:</p>\n')
fin = open(sys.argv[10], 'r')
fout.write(fin.read())
fin.close()
fout.write('<p>All ratings are calculated using <a href="http://www.remi-coulom.fr/Bayesian-Elo/">Bayesian Elo</a> with eloAdvantage = 0, eloDraw = 0.01, and default prior.</p>\n')
fout.write('<p>The Elo ratings for gomoku and renju rules are from different rating systems, and should not be compared directly.</p>\n')
fout.close()