simplify move creation and allow switching between value methods
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user