Skip to content

Commit 75ee7c5

Browse files
committed
Rename Unnamed strategy.
1 parent 3dc60fb commit 75ee7c5

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

axelrod/strategies/_strategies.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
SteinAndRapoport,
1818
TidemanAndChieruzzi,
1919
FirstByTullock,
20-
UnnamedStrategy,
20+
FirstByAnonymous,
2121
)
2222
from .axelrod_second import (
2323
SecondByAppold,
@@ -281,6 +281,7 @@
281281
CyclerCCCDCD,
282282
Darwin,
283283
FirstByDavis,
284+
FirstByAnonymous,
284285
DBS,
285286
Defector,
286287
DefectorHunter,

axelrod/strategies/axelrod_first.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -650,32 +650,31 @@ def strategy(self, opponent: Player) -> Action:
650650
return random_choice(prob_cooperate)
651651

652652

653-
class UnnamedStrategy(Player):
654-
"""Apparently written by a grad student in political science whose name was
655-
withheld, this strategy cooperates with a given probability P. This
656-
probability (which has initial value .3) is updated every 10 rounds based on
657-
whether the opponent seems to be random, very cooperative or very
658-
uncooperative. Furthermore, if after round 130 the strategy is losing then P
659-
is also adjusted.
660-
661-
Fourteenth Place with 282.2 points is a 77-line program by a graduate
662-
student of political science whose dissertation is in game theory. This rule
663-
has a probability of cooperating, P, which is initially 30% and is updated
664-
every 10 moves. P is adjusted if the other player seems random, very
665-
cooperative, or very uncooperative. P is also adjusted after move 130 if the
666-
rule has a lower score than the other player. Unfortunately, the complex
667-
process of adjustment frequently left the probability of cooperation in the
668-
30% to 70% range, and therefore the rule appeared random to many other players.
653+
class FirstByAnonymous(Player):
654+
"""
655+
Submitted to Axelrod's first tournament by a graduate student whose name was
656+
withheld.
669657
670-
Names:
658+
The description written in [Axelrod1980]_ is:
671659
672-
- Unnamed Strategy: [Axelrod1980]_
660+
> "This rule has a probability of cooperating, P, which is initially 30% and
661+
> is updated every 10 moves. P is adjusted if the other player seems random,
662+
> very cooperative, or very uncooperative. P is also adjusted after move 130
663+
> if the rule has a lower score than the other player. Unfortunately, the
664+
> complex process of adjustment frequently left the probability of cooperation
665+
> in the 30% to 70% range, and therefore the rule appeared random to many
666+
> other players."
667+
668+
Given the lack of detail this strategy is implemented based on the final
669+
sentence of the description which is to have a cooperation probability that
670+
is uniformly random in the 30 to 70% range.
671+
672+
Names:
673673
674-
Warning: This strategy is not identical to the original strategy (source
675-
unavailable) and was written based on published descriptions.
674+
- (Name withheld): [Axelrod1980]_
676675
"""
677676

678-
name = "Unnamed Strategy"
677+
name = "First tournament by Anonymous"
679678
classifier = {
680679
"memory_depth": 0,
681680
"stochastic": True,

axelrod/tests/strategies/test_axelrod_first.py

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

450450

451-
class TestUnnamedStrategy(TestPlayer):
451+
class TestFirstByAnonymous(TestPlayer):
452452

453-
name = "Unnamed Strategy"
454-
player = axelrod.UnnamedStrategy
453+
name = "First tournament by Anonymous"
454+
player = axelrod.FirstByAnonymous
455455
expected_classifier = {
456456
"memory_depth": 0,
457457
"stochastic": True,

docs/reference/overview_of_strategies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ An indication is given as to whether or not this strategy is implemented in the
2929
"Feld", "Scott Feld", ":class:`Feld <axelrod.strategies.axelrod_first.FirstByFeld>`"
3030
"Joss", "Johann Joss", ":class:`Joss <axelrod.strategies.axelrod_first.FirstByJoss>`"
3131
"Tullock", "Gordon Tullock", ":class:`Tullock <axelrod.strategies.axelrod_first.FirstByTullock>`"
32-
"Unnamed Strategy", "Unknown", ":class:`UnnamedStrategy <axelrod.strategies.axelrod_first.UnnamedStrategy>`"
32+
"(Name withheld)", "Unknown", ":class:`UnnamedStrategy <axelrod.strategies.axelrod_first.FirstByAnyonymous>`"
3333
"Random", "Unknownd", ":class:`Random <axelrod.strategies.rand.Random>`"
3434

3535
Axelrod's second tournament

0 commit comments

Comments
 (0)