prune_bad_children changes

This commit is contained in:
Simon Gardling 2025-02-25 21:36:07 -05:00
parent 2d066a6a3c
commit a02dd72dc1
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -270,7 +270,6 @@ impl FutureMoves {
fn set_root_idx_raw(&mut self, idx: usize) {
self.update_root_idx_raw(idx);
self.prune_bad_children();
self.refocus_tree();
self.extend_layers();
self.compute_values(0..self.arena.len());
@ -324,9 +323,16 @@ impl FutureMoves {
const TOP_K_CHIL: usize = 2;
// the lower the value, the more conservative
const UP_TO: usize = 4;
const UP_TO: usize = 5;
// start pruning at X depth before self.max_depth
const START_PRUNING_AT_MINUS: usize = 2;
if self.max_depth > self.current_depth + START_PRUNING_AT_MINUS {
return;
}
for (depth, indexes) in by_depth {
// TODO! maybe update by_depth every iteration or something?
if depth > UP_TO {
return;
}