Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When testing my own agent I noticed that it can take quite some time to run the tournament if you have a few hundred agents, so here I added support to multiprocessing facilities in the main execution code.
I think this is something much needed when running the actual tournament, specially if you have a thousand or more agents to test, otherwise it will take a quite considerable amount of time. This obviously depends a lot on the machine where the code runs.
I've tested the code included on a 12 core machine with Ubuntu 20.04 and python 3.8.5, it is substantially faster than using the original iterative process.
I've tried to modify the original code as little as possible, on my local changes I also have additional stuff to measure how much time each agent is taking (my own takes about 20 times as long as the rest - I'll be optimizing it, but don't expect too much) as well as the generation of a grid comparing all agents with each other. If desired I can create another pull request with some of these extras.
The caveat is the possibility of issues arising in Windows machines, although I left the global variable that allows one to choose the number of child processes spawned, with zero it should work like the iterative approach. In hindsight I should have left the value set to zero, but then again the purpose of this code is to make it run faster than it was before.
An alternative to this approach would be to use MPI instead and use several remote machines in a compute cluster... but it would require a more complex setup and create more limitations for the running environment.