From 74b9c8dc965403420698b51d11be102045a2c2bc Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Sat, 22 Feb 2025 12:35:09 -0500 Subject: [PATCH] increment i by 1 for summing values --- src/complexagent.rs | 2 +- src/logic/future_moves.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/complexagent.rs b/src/complexagent.rs index c804527..19295a4 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -13,7 +13,7 @@ pub struct ComplexAgent { impl ComplexAgent { pub const fn new(color: Piece) -> Self { const MAX_DEPTH: usize = 14; - const NON_LAZY_DEPTH: usize = 5; + const NON_LAZY_DEPTH: usize = 8; Self { color, future_moves: FutureMoves::new(color, MAX_DEPTH, NON_LAZY_DEPTH), diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index 338eb8a..15291c2 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -200,7 +200,7 @@ impl FutureMoves { .rev() // rev then reverse so we get an index starting from the back .enumerate() // since children are sorted by value, we should weight the first one more - .map(|(i, &child)| self.arena[child].value * (i as i128)) + .map(|(i, &child)| self.arena[child].value * ((i + 1) as i128)) .sum::(); self.arena[idx].value =