move FutureMoveConfig usage into main.rs

This commit is contained in:
Simon Gardling 2025-02-28 13:18:05 -05:00
parent 10389ad8ee
commit 2388ee8c75
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 23 additions and 11 deletions

View File

@ -11,17 +11,10 @@ pub struct ComplexAgent {
#[allow(dead_code)]
impl ComplexAgent {
pub const fn new(color: Piece) -> Self {
const CONFIG: FutureMoveConfig = FutureMoveConfig {
max_depth: 20,
min_arena_depth_sub: 3,
top_k_children: 2,
up_to_minus: usize::MAX, // disable pruning
max_arena_size: 50_000_000,
};
pub const fn new(color: Piece, config: FutureMoveConfig) -> Self {
Self {
color,
future_moves: FutureMoves::new(color, CONFIG),
future_moves: FutureMoves::new(color, config),
}
}
}

View File

@ -1,4 +1,5 @@
use game::Game;
use logic::FutureMoveConfig;
use repr::Piece;
mod agent;
@ -9,8 +10,26 @@ pub mod repr;
// TODO! make this agent configuration a config option via `clap-rs`
fn main() {
let player1 = complexagent::ComplexAgent::new(Piece::Black);
// let player2 = complexagent::ComplexAgent::new(Piece::White);
let player1 = complexagent::ComplexAgent::new(
Piece::Black,
FutureMoveConfig {
max_depth: 20,
min_arena_depth_sub: 3,
top_k_children: 2,
up_to_minus: usize::MAX, // disable pruning
max_arena_size: 50_000_000,
},
);
// let player2 = complexagent::ComplexAgent::new(
// Piece::White,
// FutureMoveConfig {
// max_depth: 20,
// min_arena_depth_sub: 3,
// top_k_children: 2,
// up_to_minus: 5, // disable pruning
// max_arena_size: 2_000_000,
// },
// );
let player2 = agent::ManualAgent::new(Piece::White);
// let player2 = agent::RandomAgent::new(Piece::White);
let mut game = Game::new(Box::new(player1), Box::new(player2));