Skip to content

Commit b6d6e62

Browse files
committed
atempt to fix typing issues uncovered in axelrod_second
1 parent 4f18917 commit b6d6e62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

axelrod/strategies/axelrod_second.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ def strategy(self, opponent: Player) -> Action:
16611661
recent_history = opponent.history[-5:]
16621662

16631663
did_d = np.vectorize(lambda action: int(action == D))
1664-
number_defects = np.sum(did_d(recent_history))
1664+
number_defects = sum(did_d(recent_history))
16651665

16661666
return self._random.random_choice(self.prob_coop[number_defects])
16671667

@@ -1774,7 +1774,7 @@ def strategy(self, opponent: Player) -> Action:
17741774
return C
17751775

17761776
proportion_agree = self.num_agreements / turn
1777-
last_four_num = np.sum(self.last_four_agreements)
1777+
last_four_num = sum(self.last_four_agreements)
17781778
if proportion_agree > 0.9 and last_four_num >= 4:
17791779
return C
17801780
elif proportion_agree >= 0.625 and last_four_num >= 2:

0 commit comments

Comments
 (0)