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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user