aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-27 02:25:45 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-27 02:25:45 +0300
commit616f36cefb22b12ade205198c42885888a14ea6b (patch)
tree95b47f451995f9cba8a0fb61ce768edfbf37b069
parentb2faacc10da5aa76820ba49506995565d405f42b (diff)
downloadchessnost-616f36cefb22b12ade205198c42885888a14ea6b.tar.gz
feat: gradually widen aspiration windows
-rw-r--r--src/board/engine.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs
index ceee108..58c9eb5 100644
--- a/src/board/engine.rs
+++ b/src/board/engine.rs
@@ -223,6 +223,7 @@ impl Board {
return (alpha, principal_variation)
}
}
+
(alpha, principal_variation)
}
@@ -287,7 +288,7 @@ impl Board {
let mut depth = 1;
let mut alpha = -INFINITY;
let mut beta = INFINITY;
- let window_size = 0.5;
+ let window_size = 0.25;
loop {
let search_result = self.negamax_search(alpha, beta, depth, deadline);
@@ -299,18 +300,17 @@ impl Board {
None => panic!("Could not find a move in time"),
}
}
-
if search_result.1.len() > 0 {
depth += 1;
alpha = search_result.0 - window_size;
beta = search_result.0 + window_size;
} else if search_result.0 <= alpha { // Alpha-cutoff
println!("Alpha cutoff {} <= {:?}", search_result.0, (alpha, beta));
- alpha = search_result.0 - window_size;
+ alpha = search_result.0 - window_size * 4.0;
continue;
} else if search_result.0 >= beta { // Beta-cutoff
println!("Beta cutoff {:?} <= {}", (alpha, beta), search_result.0);
- beta = search_result.0 + window_size;
+ beta = search_result.0 + window_size * 4.0;
continue;
} else {
panic!("Can this ever be possible? (probably not)");