Skip to content

Commit 9940623

Browse files
committed
Fixed minor calculation issue.
1 parent d238418 commit 9940623

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

axelrod/strategies/axelrod_second.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ def strategy(self, opponent: Player) -> Action:
757757

758758
did_d = np.vectorize(lambda action: float(action == D))
759759
number_defects = np.sum(did_d(opponent.history))
760-
perc_defects = np.average(did_d(opponent.history))
760+
perc_defects = number_defects / turn # Size of numerator is smaller than denomator -- How it was in the Fortran.
761761

762762
# If overly defect or appears random
763763
if turn > 39 and perc_defects > 0.39: return D

0 commit comments

Comments
 (0)