11import datetime
2+ import itertools
23import logging
34import os
45import random
@@ -31,6 +32,11 @@ def main(number_of_games, print_logs):
3132 if not os .path .exists (replays_directory ):
3233 os .mkdir (replays_directory )
3334
35+ possible_configurations = list (itertools .combinations (BattleConfig .CLIENTS_CONFIGS , 4 ))
36+ assert len (BattleConfig .CLIENTS_CONFIGS ) == 12
37+ assert len (possible_configurations ) == 495
38+
39+ chosen_configuration = 0
3440 for i in trange (number_of_games ):
3541 if i < len (seeds ):
3642 seed_value = seeds [i ]
@@ -39,7 +45,10 @@ def main(number_of_games, print_logs):
3945
4046 replay_name = GameManager .generate_replay_name ()
4147
42- clients = [LocalClient (BattleConfig .CLIENTS_CONFIGS [x ](), print_logs , replay_name , i ) for x in range (0 , 4 )]
48+ clients = [
49+ LocalClient (possible_configurations [chosen_configuration ][x ](), print_logs , replay_name , i )
50+ for x in range (0 , 4 )
51+ ]
4352 manager = GameManager (clients , replays_directory , replay_name )
4453
4554 try :
@@ -49,6 +58,10 @@ def main(number_of_games, print_logs):
4958 manager .replay .save_failed_log ()
5059 logger .error (f"Hanchan seed={ seed_value } crashed" , exc_info = e )
5160
61+ chosen_configuration += 1
62+ if chosen_configuration == len (possible_configurations ):
63+ chosen_configuration = 0
64+
5265
5366def _set_up_bots_battle_game_logger ():
5467 logs_directory = os .path .join (battle_results_folder , "logs" )
0 commit comments