diff --git a/src/complexagent.rs b/src/complexagent.rs index 11b470f..4774107 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -13,10 +13,10 @@ pub struct ComplexAgent { impl ComplexAgent { pub const fn new(color: Piece) -> Self { const CONFIG: FutureMoveConfig = FutureMoveConfig { - max_depth: 10, + max_depth: 13, min_arena_depth_sub: 3, top_k_children: 2, - up_to_minus: 4, + up_to_minus: 3, max_arena_size: 10_000_000, }; Self { diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index 6e7f7c2..5521e59 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -255,6 +255,10 @@ impl FutureMoves { !self.agent_color, self.agent_color, )); + // because we have to regenerate root from a [`Board`] + // we need to reset the current_depth (fixes `skip_move_recovery`) + self.current_depth = 0; + self.set_root_idx_raw(0); } @@ -557,7 +561,7 @@ mod tests { board: Board::new(), winner: Winner::None, parent: None, - children: vec![1], + children: vec![], value: None, self_value: 0, color: Piece::Black, @@ -638,8 +642,9 @@ mod tests { ); } + /// tests whether or not FutureMoves can recover from multiple skips and then manually regenerating the arena #[test] - fn best_move_failure() { + fn skip_move_recovery() { let mut futm = FutureMoves::new(Piece::Black, FUTURE_MOVES_CONFIG); let mut board = Board::new().starting_pos();