diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index 575b201..d323fbf 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -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::>(); 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; } } } diff --git a/src/logic/move.rs b/src/logic/move.rs index 44c32e6..0268c56 100644 --- a/src/logic/move.rs +++ b/src/logic/move.rs @@ -21,7 +21,7 @@ pub struct Move { pub children: Vec, /// Value of this move (including children) - pub value: Option, + 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,