This commit is contained in:
Simon Gardling 2025-04-28 01:18:46 -04:00
parent c54f3a7493
commit 189a5aef58
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
3 changed files with 10 additions and 4 deletions

View File

@ -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),
),
)
})

View File

@ -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 {

View File

@ -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<MVSGameState>,
wins: u16,
@ -74,6 +74,12 @@ impl MoveValueStats {
}
}
impl PartialOrd for MoveValueStats {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for MoveValueStats {
fn cmp(&self, other: &Self) -> Ordering {
if self.state.is_some() || other.state.is_some() {