elo: fix display
This commit is contained in:
19
src/elo.rs
19
src/elo.rs
@@ -5,7 +5,7 @@ use crate::{
|
||||
logic::{ChildrenEvalMethod, FutureMoveConfig},
|
||||
repr::{Board, Piece, Winner},
|
||||
};
|
||||
use indicatif::{ParallelProgressIterator, ProgressBar, ProgressDrawTarget, ProgressStyle};
|
||||
use indicatif::{ParallelProgressIterator, ProgressStyle};
|
||||
use rand::seq::SliceRandom;
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use skillratings::{
|
||||
@@ -189,7 +189,6 @@ impl PlayerArena {
|
||||
// Spawn parallel processing in a dedicated thread
|
||||
let processing_thread = {
|
||||
let sender = sender.clone();
|
||||
let term = term.clone();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
rayon::ThreadPoolBuilder::new()
|
||||
@@ -203,22 +202,12 @@ impl PlayerArena {
|
||||
|
||||
created_pairs
|
||||
.into_par_iter()
|
||||
.progress_with({
|
||||
let a = ProgressBar::new(num as u64).with_style(
|
||||
ProgressStyle::with_template(
|
||||
"[{elapsed_precise}] {pos:>7}/{len:7} ETA: {eta}",
|
||||
)
|
||||
.expect("invalid ProgressStyle"),
|
||||
);
|
||||
a.set_draw_target(ProgressDrawTarget::term(term, 5));
|
||||
a
|
||||
})
|
||||
.progress_with_style(
|
||||
.progress_with_style({
|
||||
ProgressStyle::with_template(
|
||||
"[{elapsed_precise}] {pos:>7}/{len:7} ETA: {eta}",
|
||||
)
|
||||
.expect("invalid ProgressStyle"),
|
||||
)
|
||||
.expect("invalid ProgressStyle")
|
||||
})
|
||||
.map(|((i, j), (p1, p2))| (i, j, Self::play_two_inner(p1, p2)))
|
||||
.for_each(|(i, j, o)| {
|
||||
sender.send((i, j, o)).expect("Failed to send result");
|
||||
|
||||
Reference in New Issue
Block a user