From 155a8d0548afa0e04edd9ac926b22d81309b9acd Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 25 Feb 2025 15:34:36 -0500 Subject: [PATCH] improve binary operation --- src/complexagent.rs | 2 +- src/logic/future_moves.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/complexagent.rs b/src/complexagent.rs index 5719bfe..8e83e2e 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -12,7 +12,7 @@ pub struct ComplexAgent { #[allow(dead_code)] impl ComplexAgent { pub const fn new(color: Piece) -> Self { - const MAX_DEPTH: usize = 5; + const MAX_DEPTH: usize = 10; const NON_LAZY_DEPTH: usize = 3; Self { color, diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index 697f95a..7fcf7cf 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -65,11 +65,10 @@ impl FutureMoves { .unwrap(), ) .flat_map(|node_idx| { - if (self.arena[node_idx].is_lazy - && self.depth_of(node_idx) + 1 > self.lazy_expire) + if (self.arena[node_idx].is_lazy && self.depth_of(node_idx) >= self.lazy_expire) || !self.arena[node_idx].is_lazy { - self.generate_children(node_idx, i > self.lazy_expire) + self.generate_children(node_idx, i >= self.lazy_expire) } else { None }