Move.value: Option<i32> -> i32

This commit is contained in:
Simon Gardling 2025-03-26 17:58:22 -04:00
parent b414e39410
commit 672a523fd1
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 4 additions and 4 deletions

View File

@ -273,7 +273,7 @@ impl FutureMoves {
let children_values = self.arena[idx]
.children
.iter()
.flat_map(|&child| self.arena[child].value)
.map(|&child| self.arena[child].value)
.collect::<Vec<_>>();
let children_value = match self.config.children_eval_method {
@ -294,7 +294,7 @@ impl FutureMoves {
// we should really setup some sort of ELO rating for each commit, playing them against
// each other or something, could be cool to benchmark these more subjective things, not
// just performance (cycles/time wise)
self.arena[idx].value = Some(self.arena[idx].self_value as i32 + children_value);
self.arena[idx].value = self.arena[idx].self_value as i32 + children_value;
}
}
}

View File

@ -21,7 +21,7 @@ pub struct Move {
pub children: Vec<usize>,
/// Value of this move (including children)
pub value: Option<i32>,
pub value: i32,
/// What is the inherit value of this move (not including children)
pub self_value: i16,
@ -40,7 +40,7 @@ impl Move {
winner: board.game_winner(),
parent: None,
children: Vec::new(),
value: None,
value: i32::MIN,
color,
is_trimmed: false,
self_value: 0,