diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-01-29 01:09:07 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-01-29 01:12:56 +0300 |
commit | 68986d0b26ee2b02e34230b64bfb6f08dcf5ed7b (patch) | |
tree | e5387241339222342d65d2c0cac9182656fc71c9 /src/board/engine.rs | |
parent | 754acbc83393ae8318f48add5eaf17633c53ed19 (diff) | |
download | chessnost-68986d0b26ee2b02e34230b64bfb6f08dcf5ed7b.tar.gz |
feat: improve logs in iterative deepening
Diffstat (limited to 'src/board/engine.rs')
-rw-r--r-- | src/board/engine.rs | 7 |
1 files 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; |