Skip to content

Commit d4e1552

Browse files
committed
Modify docstring and name of Joss.
1 parent 8c59778 commit d4e1552

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

axelrod/strategies/_strategies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
FirstByFeld,
1111
FirstByGraaskamp,
1212
FirstByGrofman,
13-
Joss,
13+
FirstByJoss,
1414
Nydegger,
1515
RevisedDowning,
1616
Shubik,
@@ -347,7 +347,7 @@
347347
Hopeless,
348348
Inverse,
349349
InversePunisher,
350-
Joss,
350+
FirstByJoss,
351351
SecondByKluepfel,
352352
KnowledgeableWorseAndWorse,
353353
LevelPunisher,

axelrod/strategies/axelrod_first.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def strategy(self, opponent: Player) -> Action:
351351

352352
class FirstByGrofman(Player):
353353
"""
354-
Submitted to Axelrod's first tournament by Bernard Grofman..
354+
Submitted to Axelrod's first tournament by Bernard Grofman.
355355
356356
The description written in [Axelrod1980]_ is:
357357
@@ -381,12 +381,14 @@ def strategy(self, opponent: Player) -> Action:
381381
return random_choice(2 / 7)
382382

383383

384-
class Joss(MemoryOnePlayer):
384+
class FirstByJoss(MemoryOnePlayer):
385385
"""
386386
Submitted to Axelrod's first tournament by Johann Joss.
387387
388-
Cooperates with probability 0.9 when the opponent cooperates, otherwise
389-
emulates Tit-For-Tat.
388+
The description written in [Axelrod1980]_ is:
389+
390+
> "This rule cooperates 90% of the time after a cooperation by the other. It
391+
> always defects after a defection by the other."
390392
391393
This strategy came 12th in Axelrod's original tournament.
392394
@@ -396,7 +398,7 @@ class Joss(MemoryOnePlayer):
396398
- Hard Joss: [Stewart2012]_
397399
"""
398400

399-
name = "Joss"
401+
name = "First tournament by Joss"
400402

401403
def __init__(self, p: float = 0.9) -> None:
402404
"""

axelrod/strategies/calculator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
from axelrod.action import Action
33
from axelrod.player import Player
44

5-
from .axelrod_first import Joss
5+
from .axelrod_first import FirstByJoss
66

77
C, D = Action.C, Action.D
88

99

1010
class Calculator(Player):
1111
"""
12-
Plays like (Hard) Joss for the first 20 rounds. If periodic behavior is
12+
Plays like (Hard) FirstByJoss for the first 20 rounds. If periodic behavior is
1313
detected, defect forever. Otherwise play TFT.
1414
1515
@@ -31,7 +31,7 @@ class Calculator(Player):
3131

3232
def __init__(self) -> None:
3333
super().__init__()
34-
self.joss_instance = Joss()
34+
self.joss_instance = FirstByJoss()
3535

3636
def strategy(self, opponent: Player) -> Action:
3737
turn = len(self.history)

axelrod/tests/strategies/test_axelrod_first.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ def test_strategy(self):
272272
self.versus_test(opponent, expected_actions=actions, seed=2)
273273

274274

275-
class TestJoss(TestPlayer):
275+
class TestFirstByJoss(TestPlayer):
276276

277-
name = "Joss: 0.9"
278-
player = axelrod.Joss
277+
name = "First tournament by Joss: 0.9"
278+
player = axelrod.FirstByJoss
279279
expected_classifier = {
280280
"memory_depth": 1,
281281
"stochastic": True,

docs/reference/overview_of_strategies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ An indication is given as to whether or not this strategy is implemented in the
2727
"Graaskamp", "Jim Graaskamp", ":class:`Graaskamp <axelrod.strategies.axelrod_first.FirstByGraaskamp>`"
2828
"Downing", "Leslie Downing", ":class:`RevisedDowning <axelrod.strategies.axelrod_first.RevisedDowning>`"
2929
"Feld", "Scott Feld", ":class:`Feld <axelrod.strategies.axelrod_first.FirstByFeld>`"
30-
"Joss", "Johann Joss", ":class:`Joss <axelrod.strategies.axelrod_first.Joss>`"
30+
"Joss", "Johann Joss", ":class:`Joss <axelrod.strategies.axelrod_first.FirstByJoss>`"
3131
"Tullock", "Gordon Tullock", ":class:`Tullock <axelrod.strategies.axelrod_first.Tullock>`"
3232
"Unnamed Strategy", "Unknown", ":class:`UnnamedStrategy <axelrod.strategies.axelrod_first.UnnamedStrategy>`"
3333
"Random", "Unknownd", ":class:`Random <axelrod.strategies.rand.Random>`"

0 commit comments

Comments
 (0)