Skip to content

Commit 3ae9409

Browse files
committed
Use all the strategies rather than a curated list
1 parent d3decdc commit 3ae9409

File tree

2 files changed

+9
-106
lines changed

2 files changed

+9
-106
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@ python lookup_evolve.py -p 2 -s 3 -g 100000 -k 20 -u 0.03 -b 20 -i 4 -o evolve2
5050
### 2, 2 is the current winner:
5151
```
5252
python lookup_evolve.py -p 2 -s 2 -g 100000 -k 20 -u 0.06 -b 20 -i 4 -o evolve2-2.csv
53+
54+
python lookup_evolve.py -p 1 -s 2 -g 100000 -k 20 -u 0.1 -b 20 -i 2 -o evolve1-2.csv
55+
56+
python lookup_evolve.py -p 1 -s 2 -g 100000 -k 20 -u 0.1 -b 20 -i 2 -o evolve2-1.csv
57+
5358
```
54-
### 4, 4
59+
### 4, 4 (might take for ever / need a ton of ram)
5560
```
56-
python lookup_evolve.py -p 4 -s 4 -g 100000 -k 20 -u 0.01 -b 20 -i 4 -o evolve4-4.csv
61+
python lookup_evolve.py -p 4 -s 4 -g 100000 -k 20 -u 0.002 -b 20 -i 4 -o evolve4-4.csv
5762
```
5863
## Analyzing
5964

axelrod_utils.py

Lines changed: 2 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,8 @@
11
from __future__ import division
22
import axelrod
33

4-
54
axl = axelrod
65

7-
def get_strategies():
8-
strategies = [
9-
axl.Aggravater,
10-
axl.ALLCorALLD,
11-
axl.Alternator,
12-
axl.AlternatorHunter,
13-
axl.AntiCycler,
14-
axl.AntiTitForTat,
15-
axl.APavlov2006,
16-
axl.APavlov2011,
17-
axl.Appeaser,
18-
axl.AverageCopier,
19-
axl.BackStabber,
20-
axl.Bully,
21-
axl.Calculator,
22-
axl.Champion,
23-
axl.Cooperator,
24-
axl.CyclerCCCCCD,
25-
axl.CyclerCCCD,
26-
axl.CyclerCCD,
27-
axl.Davis,
28-
axl.Defector,
29-
axl.DoubleCrosser,
30-
axl.Eatherley,
31-
axl.Feld,
32-
axl.FirmButFair,
33-
axl.FoolMeForever,
34-
axl.FoolMeOnce,
35-
axl.ForgetfulFoolMeOnce,
36-
axl.ForgetfulGrudger,
37-
axl.Forgiver,
38-
axl.ForgivingTitForTat,
39-
axl.PSOGambler,
40-
axl.GTFT,
41-
axl.GoByMajority,
42-
axl.GoByMajority10,
43-
axl.GoByMajority20,
44-
axl.GoByMajority40,
45-
axl.GoByMajority5,
46-
axl.HardGoByMajority,
47-
axl.HardGoByMajority10,
48-
axl.HardGoByMajority20,
49-
axl.HardGoByMajority40,
50-
axl.HardGoByMajority5,
51-
axl.Golden,
52-
axl.Grofman,
53-
axl.Grudger,
54-
axl.Grumpy,
55-
axl.HardProber,
56-
axl.HardTitFor2Tats,
57-
axl.HardTitForTat,
58-
axl.Inverse,
59-
axl.InversePunisher,
60-
axl.Joss,
61-
axl.LimitedRetaliate,
62-
axl.LimitedRetaliate2,
63-
axl.LimitedRetaliate3,
64-
axl.EvolvedLookerUp,
65-
axl.MathConstantHunter,
66-
axl.NiceAverageCopier,
67-
axl.Nydegger,
68-
axl.OmegaTFT,
69-
axl.OnceBitten,
70-
axl.OppositeGrudger,
71-
axl.Pi,
72-
axl.Prober,
73-
axl.Prober2,
74-
axl.Prober3,
75-
axl.Punisher,
76-
axl.Random,
77-
axl.RandomHunter,
78-
axl.Retaliate,
79-
axl.Retaliate2,
80-
axl.Retaliate3,
81-
axl.Shubik,
82-
axl.SneakyTitForTat,
83-
axl.SoftJoss,
84-
axl.StochasticWSLS,
85-
axl.SuspiciousTitForTat,
86-
axl.Tester,
87-
axl.ThueMorse,
88-
axl.TitForTat,
89-
axl.TitFor2Tats,
90-
axl.TrickyCooperator,
91-
axl.TrickyDefector,
92-
axl.Tullock,
93-
axl.TwoTitsForTat,
94-
axl.WinStayLoseShift,
95-
axl.ZDExtort2,
96-
axl.ZDExtort2v2,
97-
axl.ZDExtort4,
98-
axl.ZDGen2,
99-
axl.ZDGTFT2,
100-
axl.ZDSet2,
101-
axl.e,
102-
]
103-
104-
strategies = [s for s in strategies if axl.obey_axelrod(s())]
105-
return strategies
106-
107-
1086
def mean(data):
1097
"""Return the sample arithmetic mean of data."""
1108
n = len(data)
@@ -148,8 +46,8 @@ def score_for(my_strategy_factory, iterations=200):
14846
run 100 repetitions and take the average to get a good estimate.
14947
"""
15048
scores_for_all_opponents = []
151-
for opponent in get_strategies():
152-
if opponent.classifier['stochastic']:
49+
for opponent in axl.ordinary_strategies:
50+
if opponent().classifier['stochastic']:
15351
repetitions = 100
15452
else:
15553
repetitions = 1

0 commit comments

Comments
 (0)