Skip to content

Commit e350819

Browse files
committed
removes scores_matrix function
1 parent 7a4b098 commit e350819

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

axelrod/payoff.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -147,49 +147,6 @@ def interaction_payoff(actions, game):
147147
return (player1_payoff, player2_payoff)
148148

149149

150-
# As yet unused until RoundRobin returns interactions
151-
def scores_matrix(interactions, game):
152-
"""
153-
Parameters
154-
----------
155-
interactions : list
156-
A list containing an interactions dictionary for each repetition in a
157-
tournmament.
158-
159-
game : axelrod.Game
160-
The game object to score the tournament.
161-
162-
Returns
163-
-------
164-
list
165-
A scores matrix of the form:
166-
167-
[
168-
[a, b, c],
169-
[d, e, f],
170-
[g, h, i],
171-
]
172-
173-
i.e. one row per player which lists the total score for each
174-
repetition.
175-
176-
In Axelrod's original tournament, there were no self-interactions
177-
(e.g. player 1 versus player 1) and so these are also excluded from the
178-
scores here.
179-
"""
180-
nplayers = player_count(interactions[0])
181-
repetitions = len(interactions)
182-
scores = [
183-
[0 for repetition in range(repetitions)] for player in range(nplayers)]
184-
for repetition in range(repetitions):
185-
payoff = payoff_matrix(interactions[repetition], game)
186-
for player in range(nplayers):
187-
for opponent in range(nplayers):
188-
if player != opponent:
189-
scores[player][repetition] += payoff[player][opponent]
190-
return scores
191-
192-
193150
def scores(payoff):
194151
"""
195152
The scores matrix excluding self-interactions

axelrod/tests/unit/test_payoff.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ def setUpClass(cls):
2828
[13, 11, 13]
2929
]
3030

31-
cls.expected_scores_matrix = [
32-
[26, 26],
33-
[24, 24],
34-
[24, 24]
35-
]
36-
3731
cls.expected_payoff = [
3832
[[11.0, 11.0], [13, 13], [15, 12]],
3933
[[13, 13], [15.0, 15.0], [14, 7]],
@@ -92,11 +86,6 @@ def test_interaction_payoff(self):
9286
payoff = ap.interaction_payoff(self.interactions[(2, 2)], Game())
9387
self.assertEqual(payoff, (13, 3))
9488

95-
def test_scores_matrix(self):
96-
interactions = [self.interactions, self.interactions]
97-
scores = ap.scores_matrix(interactions, Game())
98-
self.assertEqual(scores, self.expected_scores_matrix)
99-
10089
def test_scores(self):
10190
scores = ap.scores(self.expected_payoff)
10291
self.assertEqual(scores, self.expected_scores)

0 commit comments

Comments
 (0)