value changes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user