You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We see here that when we ran :code:`tournament.play()` it automatically repeated the round robin tournament 10 times (this is to deal with the stochasticity of the random players).
@@ -100,15 +96,16 @@ To view a ranking based on median score::
100
96
101
97
which gives::
102
98
103
-
[4, 9, 2, 7, 0, 5, 6, 8, 1, 3]
99
+
[2, 5, 0, 4, 3, 1]
104
100
105
101
Finally, to obtain the ranking in a helpful format with all the names::
106
102
107
103
results.ranked_names
108
104
109
105
which gives::
110
106
111
-
['Defector', 'Defector', 'Bully', 'Tit For Tat', 'Alternator', 'Soft Go By Majority', 'Suspicious Tit For Tat', 'Win-Stay Lose-Shift', 'Anti Tit For Tat', 'Cooperator']
107
+
['Defector', 'Defector', 'Alternator', 'Tit For Tat', 'Random: 0.5', 'Cooperator']
108
+
112
109
113
110
So in this particular instance our two defectors have won.
114
111
Let us write a little script that will throw in a new :code:`TitForTat` player until the Tit-For-Tat player wins::
@@ -124,7 +121,7 @@ Once that has run let us see how many :code:`TitForTat` players were required::
124
121
125
122
which gives::
126
123
127
-
4
124
+
3
128
125
129
126
We can wrap all this in a function and use it to see how many :code:`TitForTat` are needed to overcome a varying number :code:`Defector`::
130
127
@@ -153,7 +150,7 @@ By viewing :code:`t` we actually see that even with 50 :code:`Defector` 3 :code:
153
150
154
151
gives::
155
152
156
-
4
153
+
3
157
154
158
155
So even with a large quantity of :code:`Defector` only a small number of
0 commit comments