diff --git a/benches/future_children.rs b/benches/future_children.rs index 498b9a4..b01527a 100644 --- a/benches/future_children.rs +++ b/benches/future_children.rs @@ -7,7 +7,7 @@ use othello::{ fn extend_layers_no_pruning(depth: usize, arena_size: usize) -> usize { let config = FutureMoveConfig { max_depth: depth, - min_arena_depth_sub: 0, + min_arena_depth: 0, top_k_children: 5, up_to_minus: 4, max_arena_size: arena_size, diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index a84bda4..b923a39 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -26,10 +26,8 @@ pub struct FutureMoveConfig { /// Max depth of that we should try and traverse pub max_depth: usize, - /// subtract this value from FutureMove.max_depth - /// and that would be the min depth an arena should fill for - /// pruning to happen - pub min_arena_depth_sub: usize, + /// the min depth an arena should fill for pruning to happen + pub min_arena_depth: usize, /// when pruning, keep the top_k # of children pub top_k_children: usize, @@ -357,9 +355,7 @@ impl FutureMoves { } fn prune_bad_children(&mut self) { - if self.config.max_depth > (self.current_depth + self.config.min_arena_depth_sub) - || self.config.do_not_prune - { + if self.current_depth < self.config.min_arena_depth || self.config.do_not_prune { return; } @@ -466,7 +462,7 @@ mod tests { const FUTURE_MOVES_CONFIG: FutureMoveConfig = FutureMoveConfig { max_depth: 3, // we want great-grand children for traversing moves - min_arena_depth_sub: 0, + min_arena_depth: 0, top_k_children: 1, up_to_minus: 0, max_arena_size: 100, diff --git a/src/main.rs b/src/main.rs index 378e296..0bd349a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ fn main() { Piece::Black, FutureMoveConfig { max_depth: 20, - min_arena_depth_sub: 14, + min_arena_depth: 14, top_k_children: 2, up_to_minus: 10, max_arena_size: 50_000_000,