increment i by 1 for summing values

This commit is contained in:
Simon Gardling 2025-02-22 12:35:09 -05:00
parent a2f302b4b0
commit 74b9c8dc96
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 2 additions and 2 deletions

View File

@ -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),

View File

@ -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::<i128>();
self.arena[idx].value =