From 68986d0b26ee2b02e34230b64bfb6f08dcf5ed7b Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 29 Jan 2023 01:09:07 +0300 Subject: feat: improve logs in iterative deepening --- src/board/engine.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/board/engine.rs b/src/board/engine.rs index 8809378..c4aa615 100644 --- a/src/board/engine.rs +++ b/src/board/engine.rs @@ -317,7 +317,6 @@ impl Board { // Could not finish in time, return what we have so far if Instant::now() > deadline { - println!("Returning early!"); return (alpha, principal_variation) } } @@ -387,16 +386,20 @@ impl Board { let mut gradual_widening_counter = 0; while depth <= max_depth { + println!("\nSearching depth({}) in the window {:?}", depth, (alpha, beta)); let search_result = self.negamax_search(alpha, beta, depth, deadline); - println!("Finished depth({}) {:?} [{:?} left]", depth, search_result, deadline - Instant::now()); if search_result.0.abs() >= VALUE_WIN { return search_result } if Instant::now() > deadline { + println!("Aborting..."); break; } + + println!("Finished depth({}) {:?} [{:?} left]", depth, search_result, deadline - Instant::now()); + if search_result.1.len() > 0 { depth += 1; gradual_widening_counter = 0; -- cgit v1.2.3