pub mod mcts; mod net; pub mod train; use chess::Game; pub const DEFAULT_MAX_DEPTH: u16 = 6; pub const DEFAULT_PLAYER_TIME_REMAINING_MS: u64 = 120_000; // 2 minutes pub const DEFAULT_PLAYER_INCREMENT_MS: u64 = 0; pub struct Engine { pub game: Game, pub search_settings: SearchSettings, } pub struct SearchSettings { pub wtime: u64, pub btime: u64, pub winc: u64, pub binc: u64, pub movetime: Option, pub max_depth: Option, pub max_nodes: Option, } impl Default for SearchSettings { fn default() -> Self { SearchSettings::new(None, None, None, None, None, None, None) } } impl SearchSettings { pub fn new( wtime: Option, btime: Option, winc: Option, binc: Option, movetime: Option, max_depth: Option, max_nodes: Option, ) -> Self { SearchSettings { wtime: wtime.unwrap_or(DEFAULT_PLAYER_TIME_REMAINING_MS), btime: btime.unwrap_or(DEFAULT_PLAYER_TIME_REMAINING_MS), winc: winc.unwrap_or(DEFAULT_PLAYER_INCREMENT_MS), binc: binc.unwrap_or(DEFAULT_PLAYER_INCREMENT_MS), movetime, max_depth, max_nodes, } } } impl Default for Engine { fn default() -> Self { Engine::new(None) } } impl Engine { pub fn new(search_settings: Option) -> Self { Engine { game: Game::new(), search_settings: search_settings.unwrap_or(SearchSettings::default()), } } pub fn go(&mut self) {} }