increment i by 1 for summing values
This commit is contained in:
parent
a2f302b4b0
commit
74b9c8dc96
@ -13,7 +13,7 @@ pub struct ComplexAgent {
|
|||||||
impl ComplexAgent {
|
impl ComplexAgent {
|
||||||
pub const fn new(color: Piece) -> Self {
|
pub const fn new(color: Piece) -> Self {
|
||||||
const MAX_DEPTH: usize = 14;
|
const MAX_DEPTH: usize = 14;
|
||||||
const NON_LAZY_DEPTH: usize = 5;
|
const NON_LAZY_DEPTH: usize = 8;
|
||||||
Self {
|
Self {
|
||||||
color,
|
color,
|
||||||
future_moves: FutureMoves::new(color, MAX_DEPTH, NON_LAZY_DEPTH),
|
future_moves: FutureMoves::new(color, MAX_DEPTH, NON_LAZY_DEPTH),
|
||||||
|
|||||||
@ -200,7 +200,7 @@ impl FutureMoves {
|
|||||||
.rev() // rev then reverse so we get an index starting from the back
|
.rev() // rev then reverse so we get an index starting from the back
|
||||||
.enumerate()
|
.enumerate()
|
||||||
// since children are sorted by value, we should weight the first one more
|
// 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>();
|
.sum::<i128>();
|
||||||
|
|
||||||
self.arena[idx].value =
|
self.arena[idx].value =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user