-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtournement-run.py
31 lines (27 loc) · 1016 Bytes
/
tournement-run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import itertools
import subprocess
def generate_matches(teams):
# Generates all possible matches where each team plays against each other
# both as red and blue.
for team1, team2 in itertools.permutations(teams, 2):
yield team1, team2
def main():
teams = [
"MCTSPacmanAgent_offensiveAgent",
"MCTSPacmanAgent_defensiveAgent",
"MCTSPacmanAgent_OffensiveReflexAgent",
"MCTSPacmanAgent_DefensiveReflexAgent",
"offensiveAgent_defensiveAgent",
"offensiveAgent_OffensiveReflexAgent",
"offensiveAgent_DefensiveReflexAgent",
"defensiveAgent_OffensiveReflexAgent",
"defensiveAgent_DefensiveReflexAgent",
"OffensiveReflexAgent_DefensiveReflexAgent",
"MCTSPacmanAgent_MCTSPacmanAgent2",
]
matches = list(generate_matches(teams))
for red_team, blue_team in matches:
command = f"python capture.py -r {red_team} -b {blue_team}"
subprocess.run(command, shell=True)
if __name__ == "__main__":
main()