summaryrefslogtreecommitdiff
path: root/src/strategy/mcts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/strategy/mcts.rs')
-rw-r--r--src/strategy/mcts.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/strategy/mcts.rs b/src/strategy/mcts.rs
index 5a43c6e..b7478b8 100644
--- a/src/strategy/mcts.rs
+++ b/src/strategy/mcts.rs
@@ -41,9 +41,9 @@ pub fn choose_move(
let _ = mcts(&mut root_node);
}
- //eprintln!("Number of simulations: {}", root_node.score_sum.visit_count);
+ eprintln!("Number of simulations: {}", root_node.score_sum.visit_count);
for (command, score_sum) in &root_node.player_score_sums[0] {
- //eprintln!(
+ eprintln!(
"{} = {} ({} visits)",
command,
score_sum.avg().val,
@@ -164,8 +164,8 @@ fn mcts(node: &mut Node) -> Score {
}
fn mcts_move_combo(state: &GameBoard) -> Vec<[Command; 2]> {
- let player_moves = self.valid_moves(0);
- let opponent_moves = self.valid_moves(1);
+ let player_moves = state.valid_moves(0);
+ let opponent_moves = state.valid_moves(1);
debug_assert!(!player_moves.is_empty(), "No player moves");
debug_assert!(!opponent_moves.is_empty(), "No opponent moves");
@@ -228,5 +228,3 @@ fn update(node: &mut Node, commands: [Command; 2], score: Score) {
.or_insert_with(ScoreSum::new) += score;
node.score_sum += score;
}
-
-