#[derive(Debug, Clone)]
pub struct MctsConfig {
pub exploration_constant: f64,
pub max_iterations: usize,
pub max_simulation_depth: usize,
pub use_policy_priors: bool,
pub temperature: f64,
pub min_visits_for_expansion: usize,
pub reuse_tree: bool,
pub dirichlet_alpha: f64,
pub dirichlet_epsilon: f64,
}
impl Default for MctsConfig {
fn default() -> Self {
Self {
exploration_constant: std::f64::consts::SQRT_2,
max_iterations: 1000,
max_simulation_depth: 100,
use_policy_priors: true,
temperature: 1.0,
min_visits_for_expansion: 1,
reuse_tree: false,
dirichlet_alpha: 0.3,
dirichlet_epsilon: 0.25,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_mcts_config_default() {
let config = MctsConfig::default();
assert_eq!(config.max_iterations, 1000);
assert!(config.exploration_constant > 0.0);
assert!(config.use_policy_priors);
}
}