diff --git a/src/engine/eval.rs b/src/engine/eval.rs index 19e6374..d06b733 100644 --- a/src/engine/eval.rs +++ b/src/engine/eval.rs @@ -1,5 +1,3 @@ -#[cfg(test)] -mod test; use crate::engine::board::*; pub trait Evaluator: Send + Sync { diff --git a/src/engine/eval/test.rs b/src/engine/pattern_eval/test.rs similarity index 82% rename from src/engine/eval/test.rs rename to src/engine/pattern_eval/test.rs index 8bbab2e..a289ef2 100644 --- a/src/engine/eval/test.rs +++ b/src/engine/pattern_eval/test.rs @@ -1,7 +1,7 @@ extern crate test; use super::*; -use crate::setup::*; use std::io::{BufRead, BufReader}; +use std::sync::Arc; use test::Bencher; fn load_stress_test_set() -> Vec<(Board, i8)> { @@ -26,13 +26,13 @@ fn load_stress_test_set() -> Vec<(Board, i8)> { #[bench] fn bench_eval(b: &mut Bencher) { - let solve_obj = setup_default(); + let evaluator = Arc::new(PatternLinearEvaluator::load(Path::new("table-220710")).unwrap()); let dataset = load_stress_test_set(); b.iter(|| { dataset .iter() - .map(|(board, _)| solve_obj.evaluator.eval(*board) as i32) + .map(|(board, _)| evaluator.eval(*board) as i32) .sum::() }); }