value changes

This commit is contained in:
2025-02-20 21:52:15 -05:00
parent 3b07a67d2e
commit 8de01ffd57
3 changed files with 7 additions and 9 deletions

View File

@@ -192,13 +192,11 @@ 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 i64 + 1))
.sum::<i64>()
.checked_div((&self.arena[idx]).children.len() as i64)
.unwrap_or(0);
.map(|(i, &child)| self.arena[child].value * (i as i128 + 1))
.sum::<i128>();
self.arena[idx].value =
self.arena[idx].self_value / (depth as i64 + 1) + children_value;
(self.arena[idx].self_value / (depth as i64 + 1)) as i128 + children_value;
}
}
}

View File

@@ -25,7 +25,7 @@ pub struct Move {
pub children: Vec<usize>,
/// Value of this move (including children)
pub value: i64,
pub value: i128,
pub self_value: i64,
@@ -61,7 +61,7 @@ impl Move {
self_value: 0,
};
m.self_value = m.compute_self_value(agent_color);
m.value = m.self_value;
m.value = m.self_value as i128;
m
}