Skip to content

Commit

Permalink
Merge pull request #47 from primenumber/refine-self-play
Browse files Browse the repository at this point in the history
Refine self play
  • Loading branch information
primenumber committed May 5, 2024
2 parents 5380184 + 9cff2b1 commit 0c2322a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/play.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,28 @@ pub fn self_play(matches: &ArgMatches) -> Board {
period: start,
time_limit,
};
let mut searcher = Searcher {
let searcher = Searcher {
evaluator: solve_obj.evaluator.clone(),
cache: solve_obj.eval_cache.clone(),
timer: Some(timer),
node_count: 0,
cache_gen: solve_obj.cache_gen,
};
let (score, best, depth) = searcher.iterative_think(
let (score, best, depth, node_count) = think_parallel(
&searcher,
board.board,
searcher.evaluator.score_min(),
searcher.evaluator.score_max(),
false,
3,
0,
);
let secs = start.elapsed().as_secs_f64();
let nps = (searcher.node_count as f64 / secs) as u64;
let nps = (node_count as f64 / secs) as u64;
eprintln!(
"Estimated result: {}, Depth: {}, Nodes: {}, NPS: {}",
score, depth, searcher.node_count, nps
score as f32 / searcher.evaluator.score_scale() as f32,
depth,
node_count,
nps
);
best
} else {
Expand Down

0 comments on commit 0c2322a

Please sign in to comment.