initial elo rating stuff
This commit is contained in:
@@ -41,6 +41,8 @@ pub struct FutureMoveConfig {
|
||||
pub max_arena_size: usize,
|
||||
|
||||
pub do_not_prune: bool,
|
||||
|
||||
pub print: bool,
|
||||
}
|
||||
|
||||
impl FutureMoves {
|
||||
@@ -92,7 +94,7 @@ impl FutureMoves {
|
||||
}
|
||||
|
||||
for _ in self.current_depth..self.config.max_depth {
|
||||
let pstyle_inner = if cfg!(test) {
|
||||
let pstyle_inner = if cfg!(test) || !self.config.print {
|
||||
""
|
||||
} else {
|
||||
&format!(
|
||||
@@ -273,7 +275,9 @@ impl FutureMoves {
|
||||
self.set_root_idx_raw(curr_board_idx);
|
||||
false
|
||||
} else {
|
||||
println!("regenerating arena from board");
|
||||
if self.config.print {
|
||||
println!("regenerating arena from board");
|
||||
}
|
||||
self.set_root_from_board(*board);
|
||||
true
|
||||
}
|
||||
@@ -304,6 +308,9 @@ impl FutureMoves {
|
||||
|
||||
self.refocus_tree();
|
||||
self.extend_layers();
|
||||
if self.config.print {
|
||||
println!("# of moves stored: {}", self.arena_len());
|
||||
}
|
||||
self.compute_values(0..self.arena.len());
|
||||
|
||||
// check arena's consistancy
|
||||
@@ -467,6 +474,7 @@ mod tests {
|
||||
up_to_minus: 0,
|
||||
max_arena_size: 100,
|
||||
do_not_prune: true,
|
||||
print: false,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user