Skip to content

Commit

Permalink
chore: less publicity
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Jun 6, 2024
1 parent 324e32d commit 5c80c80
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mcts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Searcher {
expanded
}

pub fn select(&mut self, position: &mut ataxx::Position, depth: &mut usize) -> NodePtr {
fn select(&mut self, position: &mut ataxx::Position, depth: &mut usize) -> NodePtr {
let policy = self.policy;
let mut node_ptr: NodePtr = 0;

Expand Down Expand Up @@ -163,7 +163,7 @@ impl Searcher {
// node-q + policy * cpuct * sqrt(node-visits) / (1 + child-visits = 1)
// child-q + policy * cpuct * sqrt(node-visits) / (1 + child-visits)
// ^-----^ score / visits
pub fn select_edge(&self, ptr: NodePtr) -> EdgePtr {
fn select_edge(&self, ptr: NodePtr) -> EdgePtr {
let node = self.node(ptr);

// Node exploitation factor (cpuct * sqrt(parent-playouts))
Expand Down Expand Up @@ -200,7 +200,7 @@ impl Searcher {
best_ptr
}

pub fn expand(&mut self, parent: NodePtr, position: &mut ataxx::Position) -> NodePtr {
fn expand(&mut self, parent: NodePtr, position: &mut ataxx::Position) -> NodePtr {
if position.is_game_over() {
return parent;
}
Expand All @@ -227,7 +227,7 @@ impl Searcher {
new_ptr
}

pub fn simulate(&mut self, position: &ataxx::Position) -> f64 {
fn simulate(&mut self, position: &ataxx::Position) -> f64 {
if position.is_game_over() {
let winner = position.winner();
return if winner == ataxx::Piece::None {
Expand All @@ -242,7 +242,7 @@ impl Searcher {
(self.value)(position)
}

pub fn backpropagate(&mut self, ptr: NodePtr, result: f64) {
fn backpropagate(&mut self, ptr: NodePtr, result: f64) {
let mut node_ptr = ptr;
let mut result = result;

Expand Down

0 comments on commit 5c80c80

Please sign in to comment.