simplify move creation and allow switching between value methods

This commit is contained in:
2025-04-20 01:43:00 -04:00
parent 5e4e240e33
commit 517e54dade
2 changed files with 43 additions and 36 deletions

View File

@@ -36,7 +36,13 @@ pub struct Move {
}
impl Move {
pub fn new(coord: MoveCoord, board: Board, color: Piece, agent_color: Piece) -> Self {
pub fn new(
coord: MoveCoord,
board: Board,
color: Piece,
agent_color: Piece,
use_weighted_bvm: bool,
) -> Self {
let mut m = Move {
coord,
winner: board.game_winner(),
@@ -47,7 +53,7 @@ impl Move {
is_trimmed: false,
self_value: 0,
};
m.self_value = m.compute_self_value(agent_color, &board, true);
m.self_value = m.compute_self_value(agent_color, &board, use_weighted_bvm);
m
}