Trait zero_sum::analysis::search::Analysis [] [src]

pub trait Analysis: Display {
    fn as_any(&self) -> &Any;
}

The results of the search.

The search returns a boxed Analysis, which can either be printed as-is, or downcast into a concrete analysis type from a particular search.

Example

use zero_sum::analysis::search::{PvSearch, PvSearchAnalysis, Search};

let state = State::new();
let (interrupt_sender, interrupt_receiver) = std::sync::mpsc::channel();

let evaluator = Evaluator;
let mut search = PvSearch::with_depth(evaluator, 5);
let analysis = search.search(&state, Some(interrupt_receiver));

println!("{}", analysis);

let pvsearch_analysis = analysis.as_any().downcast_ref::<PvSearchAnalysis<State, Evaluator>>().unwrap();
println!("{}", pvsearch_analysis.evaluation);

Required Methods

Implementors