[+] A2 P3.2 run_learning_algorithm

This commit is contained in:
Hykilpikonna
2022-02-19 22:08:49 -05:00
parent 18b5b94094
commit 8ed1f8c05a
+9 -1
View File
@@ -112,7 +112,15 @@ def run_learning_algorithm(exploration_probabilities: list[float],
# Play games using the ExploringPlayer and update the GameTree after each one
results_so_far = []
# Write your loop here, according to the description above.
# Loop through each probability, play games
for exp_prob in exploration_probabilities:
# Run game
winner, seq = a2_minichess.run_game(ExploringPlayer(game_tree, exp_prob),
a2_minichess.RandomPlayer())
# After the game, insert move sequence with white win probability
game_tree.insert_move_sequence(seq, float(winner == 'White'))
# Print progress
print(f'Winner: {winner}')
if show_stats:
a2_minichess.plot_game_statistics(results_so_far)