-
Notifications
You must be signed in to change notification settings - Fork 1
/
simulation.html
143 lines (134 loc) · 6.15 KB
/
simulation.html
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <link href="favicon.ico" rel="icon" type="image/x-icon" />
--> <title>Math 167 - Iterated Prisoner's Dilemma Simulator</title>
<meta name="description" content="Page description, shows up in search results. Should be no longer than 150-160 characters." />
<!-- Open Graph -->
<meta property="og:title" content="The title of this page, excluding any branding." />
<meta property="og:site_name" content="Name of this website." />
<meta property="og:url" content="Canonical URL of this page, excluding session and user-identifying variables." />
<meta property="og:image" content="URL to an image for this page. Should be at least 1200x630 pixels." />
<!-- CSS -->
<!-- <link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css" />
<link href="css/app.css" rel="stylesheet" type="text/css" />
-->
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.css" type="text/css" rel="stylesheet"/>
<!-- JavaScript -->
<script src="js/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation.min.js"></script>
<script src="js/underscore-min.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/game.js"></script>
<script src="js/bot.js"></script>
<script src="js/tournament.js"></script>
<script src="js/main.js"></script>
<script id="scores-list-template" type="text/template">
<br />
<table>
<tr>
<th>Bot</th>
<th>Mean Score</th>
</tr>
<% _.each(entries, function(entry) { %>
<tr>
<td><%= entry.name %></td>
<td><%= entry.avg %></td>
</tr>
<% }); %>
</table>
</script>
<style>
#chart-title {
text-align: center;
}
header {
margin-bottom: 50px;
}
a.button {
font-size: .9em;
}
</style>
</head>
<body>
<header>
<div class="row">
<div class="large-12 columns">
<h1>Iterated Prisoner's Dilemma Simulator</h1>
<p>Click the green buttons to add strategies, then "run" to run the tournament. A description of the strategies can be found <a href="http://simzou.github.io/iterated-prisoners-dilemma/#strategies">here</a></p>
</div>
</div>
</header>
<main>
<div class="container">
<div class="row">
<div class="large-8 columns">
<div class="row">
<div class="large-3 small-6 columns">
<a class="button success add-button" id="cooperator">Add Cooperator</a>
</div>
<div class="large-3 small-6 columns">
<a class="button success add-button" id="defector">Add Defector</a>
</div>
<div class="large-3 small-6 columns">
<a class="button success add-button" id="titfortat">Add TitForTat</a>
</div>
<div class="large-3 small-6 columns">
<a class="button success add-button" id="pavlov">Add Pavlov</a>
</div>
</div>
<div class="row">
<div class="large-3 small-6 columns">
<a class="button success add-button" id="vindictive">Add Vindictive</a>
</div>
<div class="large-3 small-6 columns">
<a class="button success add-button" id="random">Add Random</a>
</div>
<div class="large-3 small-6 columns">
<a class="button success add-button" id="greedy">Add Greedy</a>
</div>
<div class="large-3 small-6 columns">
<a class="button success add-button" id="friendly">Add Friendly</a>
</div>
</div>
</div>
<div class="large-2 columns">
<a class="button alert" id="remove-button">Remove Last Added</a>
</div>
<div class="large-2 columns">
<a class="button info" id="run-button">Run</a>
<a class="button secondary" id="clear-button">Clear</a>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<p id="players"></p>
</div>
</div>
<div class="row">
<div class="large-10 columns">
<div id="chart-div" style="margin:0">
</div>
<!-- <h3 id="chart-title">Average Scores per Bot</h3>
-->
<!-- <canvas id="barchart"></canvas>
--> </div>
<div id="scores-list" class="large-2 columns">
</div>
</div>
<div class="row">
<div class="large-12 columns">
<a id="battle-log-button" class="button">Show Full Tournament Log</a>
<div id="battle-log"></div>
</div>
</div>
</div>
</main>
<footer></footer>
<script>
$(document).foundation();
</script>
</body>
</html>