Skip to content

Commit 8677b58

Browse files
committed
Edit all_strategies
Remove 1.0 from division Update docstrings to reflect lack of information Change docstrings Formatting fix
1 parent d0d0800 commit 8677b58

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

axelrod/strategies/verybad.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ class VeryBad(Player):
88
It cooperates in the first three rounds, and uses probability
99
(it implements a memory, which stores the opponent’s moves) to decide for
1010
cooperating or defecting.
11-
11+
Due to a lack of information as to what that probability refers to in this
12+
context, probability(P(X)) refers to (Count(X)/Total_Moves) in this
13+
implementation
14+
P(C) = Cooperations / Total_Moves
15+
P(D) = Defections / Total_Moves = 1 - P(C)
16+
1217
Names:
1318
1419
- VeryBad: [Andre2013]_
@@ -34,7 +39,7 @@ def strategy(opponent: Player) -> Action:
3439
total_moves = len(opponent.history)
3540
cooperations = opponent.cooperations
3641

37-
cooperation_probability = cooperations / (total_moves * 1.0)
42+
cooperation_probability = cooperations / total_moves
3843

3944
if cooperation_probability > 0.5:
4045
return C

docs/reference/all_strategies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Here are the docstrings of all the strategies in the library.
138138
.. automodule:: axelrod.strategies.titfortat
139139
:members:
140140
:undoc-members:
141-
.. automodule:: axelrod.strategies.worse_and_worse
141+
.. automodule:: axelrod.strategies.verybad
142142
:members:
143143
:undoc-members:
144144
.. automodule:: axelrod.strategies.worse_and_worse

0 commit comments

Comments
 (0)