-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
256 lines (204 loc) · 6.9 KB
/
index.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<html>
<header>
<title>Iterated Prisoners' Dilemma Simulation</title>
<meta charset="utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="main.js"></script>
<script src="simulation.js"></script>
<script src="jquery.flot.min.js"></script>
<link rel="stylesheet" type="text/css" href="foundation.css">
<link rel="stylesheet" type="text/css" href="myCss.css">
</header>
<body>
<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name">
<h1><a href="#">Iterated Prisoners' Dilemma</a></h1>
</li>
</ul>
<section class="top-bar-section">
<!-- Left Nav Section -->
<ul class="left">
<li><a class="button [radius round]" id="settingsToggle" href="#">Settings</a></li>
<li><a class="alert button" id="graphsToggle" href="#">Graphs</a></li>
<li><a class="button [radius round]" id="instructionsToggle" href="#">Instructions</a></li>
</ul>
</section>
</nav>
<br/>
<div class="row" id="resultsDiv">
<textarea rows="4" cols="50" id="debug"></textarea>
<div class="large-6 columns">
<table>
<h4>Player Counts</h4>
<tr>
<td>
Iterations:
<input id="iterations" type="text" min="0" maxlength="3">
</td>
</tr>
<tr>
<td>
Pushover:
<input id="pushoverCount" type="text" min="0" maxlength="2">
</td>
<td>
Tit-for-tat:
<input id="titForTatCount" type="text" min="0" maxlength="2">
</td>
<td>
Suspicious Tit-for-tat:
<input id="suspiciousTitForTatCount" type="text" min="0" maxlength="2">
</td>
</tr>
<tr>
<td>GrimTrigger:
<input id="grimTriggerCount" type="text" min="0" maxlength="2">
</td>
<td>Random:
<input id="randomCount" type="text" min="0" maxlength="2">
</td>
<td>
Tit for Two Tats:
<input id="titForTwoTatCount" type="text" min="0" maxlength="2">
</td>
</tr>
<tr>
<td>Defector:
<input id="defectorCount" type="text" min="0" maxlength="2">
</td>
<td>Generous Randomizer:
<input id="generousRandomizerCount" type="text" min="0" maxlength="2">
</td>
<td>
Double Tit for Tat:
<input id="doubleTitForTatCount" type="text" min="0" maxlength="2">
</td>
</tr>
<tr>
<td>GrimTrigger 75%:
<input id="grim75count" type="text" min="0" maxlength="2">
</td>
<td>Very Suspicious Tit for Tat:
<input id="7TitForTatCount" type="text" min="0" maxlength="2">
</td>
</tr>
</table>
<button id="button" type="button">Run Simulation</button>
</div>
<div id="rankings" class="large-6 columns">
</div>
<!--
<div class="large-4 columns">
<textarea id="textarea"></textarea>
</div> -->
</div>
<div class="row" id="graphsDiv">
<div class="row">
<div class="large-8 columns">
<h5>Score of Best Performing Player of Each Strategy vs. Rounds</h5>
</div>
</div>
<div class="row">
<div class="large-8 columns" id="graph" style="width:600px;height:300px">
</div>
<div class="large-4 columns" id="legend">
</div>
</div>
<div class="row">
<div class="large-4 columns">
<h4>Info: </h4>
<p>
The graphs plot the score of the top scoring player of each strategy.
For example, if you have entered 50 players into the pool to play Tit-For-Tat, only the
tit-for-tat player whose score was the highest will be graphed.
</p>
</div>
<div class="large-4 columns">
</div>
</div>
</div>
<div class id="instructionsDiv">
<center><h3>Instructions</h3></center>
<div class="row">
<div class="large-4 columns">
<h4>How this works: </h4>
<p>
This app allows you to create a group of players who will play the group iterated prisoners' dilemma
with each other.
On the settings tab, you will specify how many players of each strategy will be entered into the
pool and how many rounds of the tournament will be played.
</p>
</div>
<div class="large-4 columns">
<h4>Rules</h4>
<p>
At each round, each player plays one prisoners' dilemma game with every other player in the pool.
After each individual game, each player updates his personal cumulative score that carries across every single game he plays. To clarify, in a tournament with <b>R</b> rounds, and <b>N</b> players, each player plays <b>R</b> games with each of the <b>N - 1</b> players in the pool.
</p>
</div>
<div class="large-4 columns">
<h4>Payoffs</h4>
<ul>
<li>If both players cooperate, both get +1.</li>
<li>If player 1 cooperates and player 2 defects, player 1 gets -2 and player 2 gets +2.</li>
<li>If both players defect, both get -1.</li>
</ul>
</div>
</div>
<div class="row">
<div class="large-4 columns">
<h4>Additional stipulations</h4>
<p>
This game has an additional twist. If a player's score drops below zero, the player is considered a "loser" and is removed from the pool. Every player starts off with a score of 50.
</p>
</div>
<div class="large-8 columns">
<h4>Explanation of Strategies</h4>
<ul>
<li>
Pushover: Cooperates 100% of the time.
</li>
<li>
Defector: Defects 100% of the time.
</li>
<li>
Random: Cooperates 50% of the time, defects 50% of the time randomly.
</li>
<li>
GrimTrigger (Chris): Cooperates with opponent until the first time opponent defects.
Then defect against opponent forever.
</li>
<li>
Double Tit For Tat (Dr. Schwab): Cooperates on the first two moves. On move t, look
at opponent's move for t-1 and t-2. If they are both the same, perform the opponent's
move. Else, make the move you made on the previous turn t-1.
</li>
<li>
Generous Randomizer (Nate): Cooperate with 90% probability, defect with 10% probability.
</li>
<li>
Tit For Tat (Scott): Cooperate on turn 1. For turns after turn 1, make the move that
your opponent made on the previous turn.
</li>
<li>
Suspicious Tit For Tat (David): Defect on turn 1. For turns after turn 1, make the move that
your opponent made on the previous turn.
</li>
<li>
Very Suspicious Tit For Tat (Robin): Defect for the first 7 rounds. Then play tit for tat.
</li>
<li>
Tit for Two Tats (Melissa): Cooperate on turn 1 and turn 2. If opponent's last two turns were
defects, defect as well. Else cooperate.
</li>
<li>
Grim75 (Vickie): Play Grim Trigger for 75% of the game (after 75% of the turns have passed).
Then always defect.
</li>
</ul>
</div>
<div>
</div>
</body>
</html>