From c4901c8c47cbec59cdb7c215f77fd40c850157a5 Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Thu, 6 Jun 2024 16:35:10 +0530 Subject: [PATCH] chore: rename simulate into value --- src/mcts/graph.rs | 8 ++++---- src/mcts/mod.rs | 2 +- src/mcts/{simulate.rs => value.rs} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename src/mcts/{simulate.rs => value.rs} (84%) diff --git a/src/mcts/graph.rs b/src/mcts/graph.rs index c7ed321..0f2b7a8 100644 --- a/src/mcts/graph.rs +++ b/src/mcts/graph.rs @@ -1,4 +1,4 @@ -use super::{policy, simulate, EdgePtr, Node, NodePtr, Params}; +use super::{policy, value, EdgePtr, Node, NodePtr, Params}; use ataxx::MoveStore; pub struct Tree { @@ -6,13 +6,13 @@ pub struct Tree { nodes: Vec, params: Params, policy: policy::Fn, - simulator: simulate::Fn, + simulator: value::Fn, } impl Tree { pub fn new(position: ataxx::Position) -> Tree { + let value = value::material; let policy = policy::handcrafted; - let simulator = simulate::material_count; let mut root = Node::new(-1); root.expand(&position, policy); @@ -22,7 +22,7 @@ impl Tree { nodes: vec![root], params: Params::new(), policy, - simulator, + simulator: value, } } diff --git a/src/mcts/mod.rs b/src/mcts/mod.rs index 3e8616e..2aaf5eb 100644 --- a/src/mcts/mod.rs +++ b/src/mcts/mod.rs @@ -3,7 +3,7 @@ pub mod policy; mod graph; mod node; mod params; -mod simulate; +mod value; pub use self::graph::*; pub use self::node::*; diff --git a/src/mcts/simulate.rs b/src/mcts/value.rs similarity index 84% rename from src/mcts/simulate.rs rename to src/mcts/value.rs index aada7da..1fb89ff 100644 --- a/src/mcts/simulate.rs +++ b/src/mcts/value.rs @@ -1,6 +1,6 @@ pub type Fn = fn(position: &ataxx::Position) -> f64; -pub fn material_count(position: &ataxx::Position) -> f64 { +pub fn material(position: &ataxx::Position) -> f64 { let stm = position.side_to_move; let stm_piece_n = position.bitboard(stm).cardinality();