From 189a5aef583332b33537227115890076de9ec949 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 28 Apr 2025 01:18:46 -0400 Subject: [PATCH] fix --- src/elo.rs | 4 ++-- src/logic/future_moves.rs | 2 +- src/logic/mvs.rs | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/elo.rs b/src/elo.rs index f54450d..62a715c 100644 --- a/src/elo.rs +++ b/src/elo.rs @@ -176,8 +176,8 @@ impl PlayerArena { ( (i, j), ( - (&self.players[i].1)(Piece::Black), - (&self.players[j].1)(Piece::White), + (self.players[i].1)(Piece::Black), + (self.players[j].1)(Piece::White), ), ) }) diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index f6e9849..269f2d4 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -322,7 +322,7 @@ impl FutureMoves { .unwrap_or(0); self.arena[idx].value.value = - self.arena[idx].self_value.value as i32 + child_value; + self.arena[idx].self_value.value + child_value; } ChildrenEvalMethod::MinMaxProb => { let child_value = if self.arena[idx].color == self.agent_color { diff --git a/src/logic/mvs.rs b/src/logic/mvs.rs index 7ad4ea0..4184bc0 100644 --- a/src/logic/mvs.rs +++ b/src/logic/mvs.rs @@ -8,7 +8,7 @@ pub enum MVSGameState { Loss = -1, } -#[derive(Clone, Copy, Debug, Allocative, PartialEq, Eq, Default, PartialOrd)] +#[derive(Clone, Copy, Debug, Allocative, PartialEq, Eq, Default)] pub struct MoveValueStats { state: Option, wins: u16, @@ -74,6 +74,12 @@ impl MoveValueStats { } } +impl PartialOrd for MoveValueStats { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + impl Ord for MoveValueStats { fn cmp(&self, other: &Self) -> Ordering { if self.state.is_some() || other.state.is_some() {