## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
• Create your own community
##### Activity
• Aug 13 02:58
marcharper commented #1250
• Aug 12 12:54
drvinceknight commented #1250
• Aug 12 12:51
drvinceknight commented #1251
• Aug 07 05:21
marcharper labeled #1251
• Aug 07 05:20
marcharper opened #1251
• Aug 03 16:38
marcharper edited #535
• Aug 03 16:37
marcharper edited #535
• Jul 23 13:29
marcharper edited #1250
• Jul 23 13:29
marcharper closed #1246
• Jul 23 13:29
marcharper opened #1250
• Jul 18 01:25
marcharper commented #1248
• Jul 17 06:54
rjsu26 commented #1248
• Jul 17 06:53
rjsu26 commented #1248
• Jul 16 09:39
Travis Axelrod-Python/Axelrod (master) passed (5456)
• Jul 16 09:30

meatballs on marcharper-patch-1

• Jul 16 09:30

meatballs on master

Update citations.md Merge pull request #1249 from A… (compare)

• Jul 16 09:30
meatballs closed #1249
• Jul 16 07:21
• Jul 16 07:21
Travis Axelrod-Python/Axelrod@19bc2eb (marcharper-patch-1) fixed (5454)
• Jul 16 07:12
marcharper opened #1249
Vince Knight
@drvinceknight
Just released v4.5.0: https://pypi.org/project/Axelrod/
Owen Campbell
@meatballs
Axelrod-Fortran v0.4.6 just released
Vince Knight
@drvinceknight
:+1:
Marc
@marcharper
Computational Insights and the Theory of Evolution - Dr. Christos Papadimitriou
Vince Knight
@drvinceknight
Nice, will give it a watch :+1:
Karol M. Langner
@langner
Vince, are you trying to get into GSOC this year?
Vince Knight
@drvinceknight
@langner it wasn't something I was actively thinking of doing. I'm not personally going to be very available during the Summer this year.
Karol M. Langner
@langner
I understand. All the best!
Aakash Doshi
@AtomicDuck
Hello, I'm trying to reproduce axelrod's first tournament (in java) I haven't reproduced the unknown strategy or graaskamp and Tit for tat is consistantly coming 4th to 6th. Is this because I havent implemented two strategies or is it because theres something wrong with my code. Thanks
Vince Knight
@drvinceknight
Hi @AtomicDuck, it could be for a combination of reasons, if you don't have the same set of players then the environment is different so you won't necessarily get the same results.
It could also be because you have errors in your code.
If you wanted to, you could run the same tournament you run with the axelrod library and compare your results with your java implementation.
John Paul Mintz
@jpmintz01

Hello,
I'm trying to use the library of strategies to infer a strategy from a dataset with paired matches of plays. Is there a way to pass a list of plays to a strategy from the library (other than manually using the axelrod.Human(name="me")?

For example, I have a dataset of a person's plays by round (C, D, D, C...) and the adversary's list of plays as well (D,C,D,C,D...). I'd like to know if the person's strategy matched TFT, TF2T, etc. I have an R script that does this manually for a small number of strategies, but re-coding every strategy has become cumbersome!

Ideally, I could just pass both to a script, but if I can just pass the adversary's plays to a for loop of the strategies in the library, I can use another mechanism to compare that output to my dataset of human plays. Thanks for any help in advance!

eric-s-s
@eric-s-s

It's been a while, but I think you could set up a MockPlayer(actions=adversary_actions_as_Axelrod.Action.C_or_D). or use Cycler(cycle=string_of_Cs_and_Ds). create a player list with this player first. create a Tournament with edges=[(0, 1), (0, 2) ... (0, len(player_list) - 1)]. that makes every passed in strategy play only the first one. see which results match your expected outcome.

this might be an example of what you want?:
https://github.com/Axelrod-Python/Axelrod/blob/master/axelrod/fingerprint.py#L237

John Paul Mintz
@jpmintz01
Thank you, @eric-s-s ! I set that up and it worked great!
Vince Knight
@drvinceknight
:+1:
Will be great to hear more about your work as it happens @jpmintz01 :)
eric-s-s
@eric-s-s
@jpmintz01 glad to hear it!
Vince Knight
@drvinceknight
v4.6.0 released with a number of small fixes, final remaining strategy from Axelrod's first tournament and a new history class: https://github.com/Axelrod-Python/Axelrod/releases/tag/v4.6.0
Owen Campbell
@meatballs
👍
Vince Knight
@drvinceknight
Using the latest release of the Axelrod library (with "as good as possible" implementations of all strategies of the first tournament) I've rerun the first tournament. The results (not unsurprisingly) don't match and I've written that up here: https://vknight.org/blog/posts/reproducing-axelrods-first-tournament/
Marc
@marcharper
Nice post
Might be interesting to note that TFT does win the second tournament, reproducibly, despite coding errors in the initial tournament
We might also think about changing
axl.RevisedDowning(revised=False)
to axl.Downing(revised=True),
pretty sure that one is on me
Lastly, an FYI: you used x A x^T in the replicator equation, which is is fine if A is symmetric I think, but note that it's more common to use x^T A x
Do you think it's worth a discussion about how the results of the tournament are so strongly dependent on the members of the tournament?
I think we are confident that several of the strategies are correct, since they appeared in later tournaments or elsewhere
Marc
@marcharper
so the changes are small and potentially rather subtle
Vince Knight
@drvinceknight
Yeah good idea about Downing(revised=True) :+1:

Might be interesting to note that TFT does win the second tournament, reproducibly, despite coding errors in the initial tournament

Yup will do!

Lastly, an FYI: you used x A x^T in the replicator equation, which is is fine if A is symmetric I think, but note that it's more common to use x^T A x

Sure although I believe this is just a question of convention on x being in $\mathbb{R}^{m\times 1}$ or $\mathbb{R}^{1\times m}$

Marc
@marcharper
Yeah it's just a convention, maybe tangent vectors are typically "column" vectors or there is some covariance / contravariance convention
Vince Knight
@drvinceknight
Latest tournament results for version 4.6.0 have been pushed: https://axelrod-tournament.readthedocs.io/en/latest/
(241 strategies)
First ten strategies are all trained ones.
Hein
@id428

Regarding the reproduction of axelrods first tournament (if it's still an issue):
In the original tournament, the strategies did not only play against each other but also a match against themselves. The latter is not the case using the tournament.play()-function. You can try this by playing a small tournament using TitForTat, Defector, Cooperator and Grudger. This is a tournament you can easily calculate by hand. The result using tournament.play() is:

players = [axl.Cooperator(), axl.Defector(), axl.TitForTat(), axl.Grudger()]
tournament = axl.Tournament(players)
results = tournament.play(progress_bar=False)

ranked = results.ranked_names # ranked list of strings of players
scores_per_turn = np.sort(np.mean(results.normalised_scores, axis=1)) # sorted list of mean scores
scores_per_turn = scores_per_turn[::-1] # reverse; now it is in ranked order
print('Ranked Players:\t',ranked)
print('Scores per turn:',scores_per_turn)

Output:

Ranked Players:     ['Defector', 'Tit For Tat', 'Grudger', 'Cooperator']
Scores per turn: [2.34666667 2.33166667 2.33166667 2.        ]

This corresponds exactly to the strategies playing against each other but not against themselves. If they also played against themselves, the ranking would be T4T, Grudger (same score as T4T) , Cooperator, Defector.

I tried using a complete graph with additional edges from one node to itself, but that didn't work either.

Hein
@id428
Not including matches against themselves might also be the reason for being able to reproduce the results (meaning the ranking, not the scores) of the second but not the first tournament. It makes a difference if there are only few strategies (<20) but not as much when there are lots of strategies (>200), where a single match doesn't have a big effect.
Marc
@marcharper
I think that the self-matches are actually played by default, because a tournament of two players has three matches
however I think we are excluding self-matches from the score and ranking processing
Marc
@marcharper
You can see the matches that are generated with list(tournament.match_generator.build_match_chunks())
[((0, 0),
{'turns': 200,
'game': Axelrod game: (R,P,S,T) = (3, 1, 0, 5),
'noise': 0,
'prob_end': None,
'match_attributes': None},
10),
((0, 1),
{'turns': 200,
'game': Axelrod game: (R,P,S,T) = (3, 1, 0, 5),
'noise': 0,
'prob_end': None,
'match_attributes': None},
10),
((1, 1),
{'turns': 200,
'game': Axelrod game: (R,P,S,T) = (3, 1, 0, 5),
'noise': 0,
'prob_end': None,
'match_attributes': None},
10)]
Marc
@marcharper
If you pass a filename to the tournament you can see that the matches are actually played
results = tournament.play(progress_bar=True, filename="tournament.csv")
We could add an option to include self-play matches in the tournament data processing
Back to the point on reproducibility, it's also the case that we are not sure what the exact definitions of the strategies in the original tournament were, and the original code no longer exists according to Axelrod himself
Unfortunately the published literature is not sufficient to unambiguously define all the strategies