Axelrod icon indicating copy to clipboard operation
Axelrod copied to clipboard

Tournament script / config file

Open marcharper opened this issue 9 years ago • 6 comments

It would be nice to be able to define and execute an external configuration file for running a tournament (not in python), something like:

[strategies]
Random, 0.4
TitForTat
...

[tournament]
rounds = 200
repetitions = 100
noise = 0.05
...

[output]
assets="output_directory"
image_format="png"
...

Then we could do something like

> run_axelrod -s script.axelrod
Running tournament with <N> strategies ...

This way we could allow people to use the library without understanding python and also have reusable tournament specifications (for the goal of reproducibility). It would also separate the internal APIs of axelrod from the actual specification of tournaments, and perhaps e.g. ease mapping a webapp to axelrod.

Any thoughts?

marcharper avatar Nov 08 '15 21:11 marcharper

YAML is good for that sort of thing and there's a python library to deal with it: http://pyyaml.org/wiki/PyYAML

meatballs avatar Nov 10 '15 19:11 meatballs

This is an awesome idea and also completely agree with @meatballs that we should use yml (have done similar for other projects).

drvinceknight avatar Nov 10 '15 21:11 drvinceknight

Great, YAML works for me.

marcharper avatar Nov 10 '15 22:11 marcharper

I'm going to look at this one next. I think this is the way that the API will need to receive definitions of tournaments to be run.

meatballs avatar Sep 12 '16 06:09 meatballs

@erik-sn @meatballs What's the current state of this re: the API?

marcharper avatar Jun 01 '17 11:06 marcharper

@marcharper sorry for the delayed response - the API can sort of do this right now, I just need to do some documentation. Essentially you would POST to /tournaments with a set of strategies and their parameters in the body. It will return JSON with the results.

I added "sort of" because this does require an HTTP client - using requests in a python script, curl, postman, a browser UI, etc.

I will try to work on documenting each of the endpoints soon, I have been distracted by some other stuff I have going on.

erik-sn avatar Jun 07 '17 14:06 erik-sn