Skip to content

Commit 5ca84b4

Browse files
committed
Add more sources.
Just the memory one ones are remaining now.
1 parent a105338 commit 5ca84b4

13 files changed

+194
-40
lines changed

axelrod/strategies/cooperator.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Cooperator(Player):
1111
1212
- Cooperator: [Axelrod1984]_
1313
- ALLC: [Press2012]_
14+
- Always cooperate: [Mittal2009]_
1415
"""
1516

1617
name = 'Cooperator'

axelrod/strategies/defector.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Defector(Player):
1111
1212
- Defector: [Axelrod1984]_
1313
- ALLD: [Press2012]_
14+
- Always defect: [Mittal2009]_
1415
"""
1516

1617
name = 'Defector'

axelrod/strategies/meta.py

+119-20
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616

1717
class MetaPlayer(Player):
18-
"""A generic player that has its own team of players."""
18+
"""
19+
A generic player that has its own team of players.
20+
21+
Names:
22+
23+
- Meta Player: Original name by Karol Langner
24+
"""
1925

2026
name = "Meta Player"
2127
classifier = {
@@ -86,7 +92,12 @@ def reset(self):
8692

8793

8894
class MetaMajority(MetaPlayer):
89-
"""A player who goes by the majority vote of all other non-meta players."""
95+
"""A player who goes by the majority vote of all other non-meta players.
96+
97+
Names:
98+
99+
- Meta Marjority: Original name by Karol Langner
100+
"""
90101

91102
name = "Meta Majority"
92103

@@ -101,7 +112,12 @@ def meta_strategy(results, opponent):
101112

102113

103114
class MetaMinority(MetaPlayer):
104-
"""A player who goes by the minority vote of all other non-meta players."""
115+
"""A player who goes by the minority vote of all other non-meta players.
116+
117+
Names:
118+
119+
- Meta Minority: Original name by Karol Langner
120+
"""
105121

106122
name = "Meta Minority"
107123

@@ -116,7 +132,12 @@ def meta_strategy(results, opponent):
116132

117133

118134
class MetaWinner(MetaPlayer):
119-
"""A player who goes by the strategy of the current winner."""
135+
"""A player who goes by the strategy of the current winner.
136+
137+
Names:
138+
139+
- Meta Winner: Original name by Karol Langner
140+
"""
120141

121142
name = "Meta Winner"
122143

@@ -162,7 +183,7 @@ class MetaWinnerEnsemble(MetaWinner):
162183
163184
Names:
164185
165-
Meta Winner Ensemble: Original name by Marc Harper
186+
- Meta Winner Ensemble: Original name by Marc Harper
166187
"""
167188

168189
name = "Meta Winner Ensemble"
@@ -182,7 +203,12 @@ def meta_strategy(self, results, opponent):
182203

183204

184205
class MetaHunter(MetaPlayer):
185-
"""A player who uses a selection of hunters."""
206+
"""A player who uses a selection of hunters.
207+
208+
Names
209+
210+
- Meta Hunter: Original name by Marc Harper
211+
"""
186212

187213
name = "Meta Hunter"
188214
classifier = {
@@ -225,7 +251,12 @@ def meta_strategy(results, opponent):
225251

226252

227253
class MetaHunterAggressive(MetaPlayer):
228-
"""A player who uses a selection of hunters."""
254+
"""A player who uses a selection of hunters.
255+
256+
Names
257+
258+
- Meta Hunter: Original name by Marc Harper
259+
"""
229260

230261
name = "Meta Hunter Aggressive"
231262
classifier = {
@@ -264,7 +295,12 @@ def meta_strategy(results, opponent):
264295

265296

266297
class MetaMajorityMemoryOne(MetaMajority):
267-
"""MetaMajority with the team of Memory One players"""
298+
"""MetaMajority with the team of Memory One players
299+
300+
Names
301+
302+
- Meta Majority Memory One: Original name by Marc Harper
303+
"""
268304

269305
name = "Meta Majority Memory One"
270306

@@ -275,7 +311,12 @@ def __init__(self):
275311

276312

277313
class MetaMajorityFiniteMemory(MetaMajority):
278-
"""MetaMajority with the team of Finite Memory Players"""
314+
"""MetaMajority with the team of Finite Memory Players
315+
316+
Names
317+
318+
- Meta Majority Finite Memory: Original name by Marc Harper
319+
"""
279320

280321
name = "Meta Majority Finite Memory"
281322

@@ -286,7 +327,12 @@ def __init__(self):
286327

287328

288329
class MetaMajorityLongMemory(MetaMajority):
289-
"""MetaMajority with the team of Long (infinite) Memory Players"""
330+
"""MetaMajority with the team of Long (infinite) Memory Players
331+
332+
Names
333+
334+
- Meta Majority Long Memory: Original name by Marc Harper
335+
"""
290336

291337
name = "Meta Majority Long Memory"
292338

@@ -297,7 +343,12 @@ def __init__(self):
297343

298344

299345
class MetaWinnerMemoryOne(MetaWinner):
300-
"""MetaWinner with the team of Memory One players"""
346+
"""MetaWinner with the team of Memory One players
347+
348+
Names
349+
350+
- Meta Winner Memory Memory One: Original name by Marc Harper
351+
"""
301352

302353
name = "Meta Winner Memory One"
303354

@@ -308,7 +359,12 @@ def __init__(self):
308359

309360

310361
class MetaWinnerFiniteMemory(MetaWinner):
311-
"""MetaWinner with the team of Finite Memory Players"""
362+
"""MetaWinner with the team of Finite Memory Players
363+
364+
Names
365+
366+
- Meta Winner Finite Memory: Original name by Marc Harper
367+
"""
312368

313369
name = "Meta Winner Finite Memory"
314370

@@ -319,8 +375,12 @@ def __init__(self):
319375

320376

321377
class MetaWinnerLongMemory(MetaWinner):
322-
"""MetaWinner with the team of Long (infinite) Memory Players"""
378+
"""MetaWinner with the team of Long (infinite) Memory Players
323379
380+
Names
381+
382+
- Meta Winner Long Memory: Original name by Marc Harper
383+
"""
324384
name = "Meta Winner Long Memory"
325385

326386
def __init__(self):
@@ -330,7 +390,12 @@ def __init__(self):
330390

331391

332392
class MetaWinnerDeterministic(MetaWinner):
333-
"""Meta Winner with the team of Deterministic Players."""
393+
"""Meta Winner with the team of Deterministic Players.
394+
395+
Names
396+
397+
- Meta Winner Deterministic: Original name by Marc Harper
398+
"""
334399

335400
name = "Meta Winner Deterministic"
336401

@@ -342,7 +407,12 @@ def __init__(self):
342407

343408

344409
class MetaWinnerStochastic(MetaWinner):
345-
"""Meta Winner with the team of Stochastic Players."""
410+
"""Meta Winner with the team of Stochastic Players.
411+
412+
Names
413+
414+
- Meta Winner Stochastic: Original name by Marc Harper
415+
"""
346416

347417
name = "Meta Winner Stochastic"
348418

@@ -367,6 +437,10 @@ class MetaMixer(MetaPlayer):
367437
distribution : list representing a probability distribution, optional
368438
This gives the distribution from which to select the players.
369439
If none is passed will select uniformly.
440+
441+
Names
442+
443+
- Meta Mixer: Original name by Vince Knight
370444
"""
371445

372446
name = "Meta Mixer"
@@ -390,7 +464,12 @@ def meta_strategy(self, results, opponent):
390464

391465

392466
class NMWEDeterministic(NiceMetaWinnerEnsemble):
393-
"""Nice Meta Winner Ensemble with the team of Deterministic Players."""
467+
"""Nice Meta Winner Ensemble with the team of Deterministic Players.
468+
469+
Names
470+
471+
- Nice Meta Winner Ensemble Deterministic: Original name by Marc Harper
472+
"""
394473

395474
name = "NMWE Deterministic"
396475

@@ -402,7 +481,12 @@ def __init__(self):
402481

403482

404483
class NMWEStochastic(NiceMetaWinnerEnsemble):
405-
"""Nice Meta Winner Ensemble with the team of Stochastic Players."""
484+
"""Nice Meta Winner Ensemble with the team of Stochastic Players.
485+
486+
Names
487+
488+
- Nice Meta Winner Ensemble Stochastic: Original name by Marc Harper
489+
"""
406490

407491
name = "NMWE Stochastic"
408492

@@ -413,7 +497,12 @@ def __init__(self):
413497

414498

415499
class NMWEFiniteMemory(NiceMetaWinnerEnsemble):
416-
"""Nice Meta Winner Ensemble with the team of Finite Memory Players."""
500+
"""Nice Meta Winner Ensemble with the team of Finite Memory Players.
501+
502+
Names
503+
504+
- Nice Meta Winner Ensemble Finite Memory: Original name by Marc Harper
505+
"""
417506

418507
name = "NMWE Finite Memory"
419508

@@ -424,7 +513,12 @@ def __init__(self):
424513

425514

426515
class NMWELongMemory(NiceMetaWinnerEnsemble):
427-
"""Nice Meta Winner Ensemble with the team of Long Memory Players."""
516+
"""Nice Meta Winner Ensemble with the team of Long Memory Players.
517+
518+
Names
519+
520+
- Nice Meta Winner Ensemble Long Memory: Original name by Marc Harper
521+
"""
428522

429523
name = "NMWE Long Memory"
430524

@@ -435,7 +529,12 @@ def __init__(self):
435529

436530

437531
class NMWEMemoryOne(NiceMetaWinnerEnsemble):
438-
"""Nice Meta Winner Ensemble with the team of Memory One Players."""
532+
"""Nice Meta Winner Ensemble with the team of Memory One Players.
533+
534+
Names
535+
536+
- Nice Meta Winner Ensemble Memory One: Original name by Marc Harper
537+
"""
439538

440539
name = "NMWE Memory One"
441540

axelrod/strategies/mindcontrol.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66

77
class MindController(Player):
8-
"""A player that changes the opponents strategy to cooperate."""
8+
"""A player that changes the opponents strategy to cooperate.
9+
10+
Names
11+
12+
- Mind Controller: Original name by Karol Langner
13+
"""
914

1015
name = 'Mind Controller'
1116
classifier = {
@@ -34,6 +39,10 @@ class MindWarper(Player):
3439
"""
3540
A player that changes the opponent's strategy but blocks changes to
3641
its own.
42+
43+
Names
44+
45+
- Mind Warper: Original name by Karol Langner
3746
"""
3847

3948
name = 'Mind Warper'
@@ -63,6 +72,10 @@ class MindBender(MindWarper):
6372
"""
6473
A player that changes the opponent's strategy by modifying the internal
6574
dictionary.
75+
76+
Names
77+
78+
- Mind Bender: Original name by Karol Langner
6679
"""
6780

6881
name = 'Mind Bender'

axelrod/strategies/mindreader.py

+18-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313

1414
class MindReader(Player):
1515
"""A player that looks ahead at what the opponent will do and decides what
16-
to do."""
16+
to do.
17+
18+
Names:
19+
20+
- Mind reader: Original name by Jason Young
21+
"""
1722

1823
name = 'Mind Reader'
1924
classifier = {
@@ -46,7 +51,12 @@ def strategy(self, opponent: Player) -> Action:
4651

4752
class ProtectedMindReader(MindReader):
4853
"""A player that looks ahead at what the opponent will do and decides what
49-
to do. It is also protected from mind control strategies"""
54+
to do. It is also protected from mind control strategies
55+
56+
Names:
57+
58+
- Protected Mind reader: Original name by Jason Young
59+
"""
5060

5161
name = 'Protected Mind Reader'
5262
classifier = {
@@ -70,7 +80,12 @@ def __setattr__(self, name: str, val: str):
7080

7181
class MirrorMindReader(ProtectedMindReader):
7282
"""A player that will mirror whatever strategy it is playing against by
73-
cheating and calling the opponent's strategy function instead of its own."""
83+
cheating and calling the opponent's strategy function instead of its own.
84+
85+
Names:
86+
87+
- Protected Mind reader: Original name by Brice Fernandes
88+
"""
7489

7590
name = 'Mirror Mind Reader'
7691

axelrod/strategies/negation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Negation(Player):
1212
1313
Names:
1414
15-
Negation - [http://www.prisoners-dilemma.com/competition.html]
15+
- Negation: [PD2017]_
1616
"""
1717

1818
name = "Negation"

0 commit comments

Comments
 (0)