Skip to content

Commit

Permalink
chore: rename simulate into value
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Jun 6, 2024
1 parent fb0f45f commit c4901c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/mcts/graph.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use super::{policy, simulate, EdgePtr, Node, NodePtr, Params};
use super::{policy, value, EdgePtr, Node, NodePtr, Params};
use ataxx::MoveStore;

pub struct Tree {
root_pos: ataxx::Position,
nodes: Vec<Node>,
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);
Expand All @@ -22,7 +22,7 @@ impl Tree {
nodes: vec![root],
params: Params::new(),
policy,
simulator,
simulator: value,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/mcts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion src/mcts/simulate.rs → src/mcts/value.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand Down

0 comments on commit c4901c8

Please sign in to comment.