Skip to content

Commit

Permalink
chore: cool, the results are inverted
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Jun 6, 2024
1 parent b43e6e0 commit 675ce87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/mcts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ impl Searcher {
let mut result = result;

loop {
result = 1.0 - result;

let node = self.tree.node(node_ptr);
let parent_node = node.parent_node;
let parent_edge = node.parent_edge;
Expand All @@ -254,7 +256,6 @@ impl Searcher {
}

node_ptr = parent_node;
result = 1.0 - result;
}
}
}
4 changes: 2 additions & 2 deletions src/mcts/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ impl Tree {
let mut best_mov = ataxx::Move::NULL;
let mut best_scr = 0.0;
for edge in root.edges.iter() {
if edge.ptr == -1 {
if edge.visits == 0 {
continue;
}

let score = 1.0 - edge.q();
let score = edge.q();

if best_mov == ataxx::Move::NULL || score > best_scr {
best_mov = edge.mov;
Expand Down

0 comments on commit 675ce87

Please sign in to comment.