Skip to content

Commit 0e2a9bf

Browse files
committed
Add long_run_time classifier
Closes #690.
1 parent 92e2c64 commit 0e2a9bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+241
-10
lines changed

axelrod/player.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class Player(object):
7373
'stochastic': False,
7474
'memory_depth': float('inf'),
7575
'makes_use_of': None,
76+
'long_run_time': False,
7677
'inspects_source': None,
7778
'manipulates_source': None,
7879
'manipulates_state': None

axelrod/strategies/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@
1212
MetaMixer
1313
)
1414

15-
all_strategies.append(MetaHunter)
15+
all_strategies.extend([MetaHunter, MetaMajority, MetaMinority, MetaWinner,
16+
MetaMajorityMemoryOne, MetaWinnerMemoryOne,
17+
MetaMajorityFiniteMemory, MetaWinnerFiniteMemory,
18+
MetaMajorityLongMemory, MetaWinnerLongMemory, MetaMixer])
1619

17-
long_run_time_strategies = [MetaMajority, MetaMinority, MetaWinner,
18-
MetaMajorityMemoryOne, MetaWinnerMemoryOne,
19-
MetaMajorityFiniteMemory, MetaWinnerFiniteMemory,
20-
MetaMajorityLongMemory, MetaWinnerLongMemory, MetaMixer]
21-
22-
all_strategies.extend(long_run_time_strategies)
2320

2421
# Distinguished strategy collections in addition to
2522
# `all_strategies` from _strategies.py
26-
2723
demo_strategies = [Cooperator, Defector, TitForTat, Grudger, Random]
2824
basic_strategies = [s for s in all_strategies if is_basic(s())]
2925
strategies = [s for s in all_strategies if obey_axelrod(s())]
26+
27+
long_run_time_strategies = [s for s in all_strategies if
28+
s().classifier['long_run_time']]
3029
cheating_strategies = [s for s in all_strategies if not obey_axelrod(s())]
3130

3231
ordinary_strategies = strategies # This is a legacy and will be removed

axelrod/strategies/adaptive.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Adaptive(Player):
1212
'memory_depth': float('inf'), # Long memory
1313
'stochastic': False,
1414
'makes_use_of': set(["game"]),
15+
'long_run_time': False,
1516
'inspects_source': False,
1617
'manipulates_source': False,
1718
'manipulates_state': False

axelrod/strategies/alternator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Alternator(Player):
99
'memory_depth': 1,
1010
'stochastic': False,
1111
'makes_use_of': set(),
12+
'long_run_time': False,
1213
'inspects_source': False,
1314
'manipulates_source': False,
1415
'manipulates_state': False

axelrod/strategies/apavlov.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class APavlov2006(Player):
1919
'memory_depth': float('inf'),
2020
'stochastic': False,
2121
'makes_use_of': set(),
22+
'long_run_time': False,
2223
'inspects_source': False,
2324
'manipulates_source': False,
2425
'manipulates_state': False
@@ -85,6 +86,7 @@ class APavlov2011(Player):
8586
'memory_depth': float('inf'),
8687
'stochastic': False,
8788
'makes_use_of': set(),
89+
'long_run_time': False,
8890
'inspects_source': False,
8991
'manipulates_source': False,
9092
'manipulates_state': False

axelrod/strategies/appeaser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Appeaser(Player):
1414
'memory_depth': float('inf'), # Depends on internal memory.
1515
'stochastic': False,
1616
'makes_use_of': set(),
17+
'long_run_time': False,
1718
'inspects_source': False,
1819
'manipulates_source': False,
1920
'manipulates_state': False

axelrod/strategies/averagecopier.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AverageCopier(Player):
1212
'memory_depth': float('inf'), # Long memory
1313
'stochastic': True,
1414
'makes_use_of': set(),
15+
'long_run_time': False,
1516
'inspects_source': False,
1617
'manipulates_source': False,
1718
'manipulates_state': False
@@ -34,6 +35,7 @@ class NiceAverageCopier(Player):
3435
'memory_depth': float('inf'), # Long memory
3536
'stochastic': True,
3637
'makes_use_of': set(),
38+
'long_run_time': False,
3739
'inspects_source': False,
3840
'manipulates_source': False,
3941
'manipulates_state': False

axelrod/strategies/axelrod_first.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Davis(Player):
2020
'memory_depth': float('inf'), # Long memory
2121
'stochastic': False,
2222
'makes_use_of': set(),
23+
'long_run_time': False,
2324
'inspects_source': False,
2425
'manipulates_source': False,
2526
'manipulates_state': False
@@ -58,6 +59,7 @@ class RevisedDowning(Player):
5859
'memory_depth': float('inf'),
5960
'stochastic': False,
6061
'makes_use_of': set(),
62+
'long_run_time': False,
6163
'inspects_source': False,
6264
'manipulates_source': False,
6365
'manipulates_state': False
@@ -134,6 +136,7 @@ class Feld(Player):
134136
'memory_depth': 200, # Varies actually, eventually becomes depth 1
135137
'stochastic': True,
136138
'makes_use_of': set(),
139+
'long_run_time': False,
137140
'inspects_source': False,
138141
'manipulates_source': False,
139142
'manipulates_state': False
@@ -189,6 +192,7 @@ class Grofman(Player):
189192
'memory_depth': float('inf'),
190193
'stochastic': True,
191194
'makes_use_of': set(),
195+
'long_run_time': False,
192196
'inspects_source': False,
193197
'manipulates_source': False,
194198
'manipulates_state': False
@@ -255,6 +259,7 @@ class Nydegger(Player):
255259
'memory_depth': 3,
256260
'stochastic': False,
257261
'makes_use_of': set(),
262+
'long_run_time': False,
258263
'inspects_source': False,
259264
'manipulates_source': False,
260265
'manipulates_state': False
@@ -309,6 +314,7 @@ class Shubik(Player):
309314
'memory_depth': float('inf'),
310315
'stochastic': False,
311316
'makes_use_of': set(),
317+
'long_run_time': False,
312318
'inspects_source': False,
313319
'manipulates_source': False,
314320
'manipulates_state': False
@@ -368,6 +374,7 @@ class Tullock(Player):
368374
'memory_depth': 11, # long memory, modified by init
369375
'stochastic': True,
370376
'makes_use_of': set(),
377+
'long_run_time': False,
371378
'inspects_source': False,
372379
'manipulates_source': False,
373380
'manipulates_state': False
@@ -422,6 +429,7 @@ class UnnamedStrategy(Player):
422429
'memory_depth': 0,
423430
'stochastic': True,
424431
'makes_use_of': set(),
432+
'long_run_time': False,
425433
'inspects_source': False,
426434
'manipulates_source': False,
427435
'manipulates_state': False

axelrod/strategies/axelrod_second.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Champion(Player):
1919
'memory_depth': float('inf'),
2020
'stochastic': True,
2121
'makes_use_of': set(["length"]),
22+
'long_run_time': False,
2223
'inspects_source': False,
2324
'manipulates_source': False,
2425
'manipulates_state': False
@@ -54,6 +55,7 @@ class Eatherley(Player):
5455
'memory_depth': float('inf'),
5556
'stochastic': True,
5657
'makes_use_of': set(),
58+
'long_run_time': False,
5759
'inspects_source': False,
5860
'manipulates_source': False,
5961
'manipulates_state': False
@@ -86,6 +88,7 @@ class Tester(Player):
8688
'memory_depth': float('inf'),
8789
'stochastic': False,
8890
'makes_use_of': set(),
91+
'long_run_time': False,
8992
'inspects_source': False,
9093
'manipulates_source': False,
9194
'manipulates_state': False

axelrod/strategies/backstabber.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class BackStabber(Player):
1616
'memory_depth': float('inf'),
1717
'stochastic': False,
1818
'makes_use_of': set(['length']),
19+
'long_run_time': False,
1920
'inspects_source': False,
2021
'manipulates_source': False,
2122
'manipulates_state': False
@@ -43,6 +44,7 @@ class DoubleCrosser(Player):
4344
'memory_depth': float('inf'),
4445
'stochastic': False,
4546
'makes_use_of': set(['length']),
47+
'long_run_time': False,
4648
'inspects_source': False,
4749
'manipulates_source': False,
4850
'manipulates_state': False

0 commit comments

Comments
 (0)