Skip to main content

Analyzer

Struct Analyzer 

Source
pub struct Analyzer<W: WarningHandling = WarningsAsErrors> {
    pub stderr: Option<ChildStderr>,
    pub child_process: Child,
    /* private fields */
}
Expand description

An instance of the KataGo analysis engine, launched as a child process.

Drop this to close the engine’s stdin and request KataGo to exit. Responses will continue to be processed until the engine actually exits.

Fields§

§stderr: Option<ChildStderr>

The analysis engine’s stderr output, if available.

§child_process: Child

The engine process.

Implementations§

Source§

impl<W: WarningHandling> Analyzer<W>

Source

pub async fn analyze( &mut self, request: AnalysisRequest, ) -> WarningResult<Option<AnalysisResult>, W>

Analyzes the final position in the game and returns a single result.

Source

pub async fn analyze_position( &mut self, request: AnalysisRequest, position: usize, ) -> WarningResult<Option<AnalysisResult>, W>

Analyzes a specific position in the game and returns a single result.

Source

pub async fn analyze_game( &mut self, request: AnalysisRequest, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>

Analyzes all moves in the game and returns a collection of results, one for each position.

Source

pub async fn analyze_positions( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>

Analyzes the specified positions in the game and returns a collection of results, one for each position.

Source

pub async fn start_analyze( &mut self, request: AnalysisRequest, ) -> Result<AnalysisProgress<W>>

Starts analyzing the final position in the game and returns a progress object which can be polled for updates.

Source

pub async fn start_analyze_position( &mut self, request: AnalysisRequest, position: usize, ) -> Result<AnalysisProgress<W>>

Starts analyzing a specific position in the game and returns a progress object which can be polled for updates.

Source

pub async fn start_analyze_game( &mut self, request: AnalysisRequest, ) -> Result<GameAnalysisProgress<W>>

Starts analyzing all moves in the game and returns a collection of progress objects.

Source

pub async fn start_analyze_positions( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, ) -> Result<GameAnalysisProgress<W>>

Starts analyzing the specified positions in the game and returns a collection of progress objects.

Source

pub async fn analyze_game_prioritized( &mut self, request: AnalysisRequest, priorities: Vec<i32>, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>

Analyzes all moves in the game with the given priorities and returns a collection of results, one for each position.

priorities must have length equal to one more than the number of moves in the game.

Source

pub async fn analyze_positions_prioritized( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, priorities: Vec<i32>, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>

Analyzes the specified positions in the game with the given priorities and returns a collection of results, one for each position.

priorities must have the same length as analyze_turns.

Source

pub async fn start_analyze_game_prioritized( &mut self, request: AnalysisRequest, priorities: Vec<i32>, ) -> Result<GameAnalysisProgress<W>>

Starts analyzing all moves in the game with the given priorities and returns a collection of progress objects.

priorities must have length equal to one more than the number of moves in the game.

Source

pub async fn start_analyze_positions_prioritized( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, priorities: Vec<i32>, ) -> Result<GameAnalysisProgress<W>>

Starts analyzing the specified positions in the game with the given priorities and returns a collection of progress objects.

priorities must have the same length as analyze_turns.

Source

pub async fn query_version(&mut self) -> WarningResult<VersionInfo, W>

Requests KataGo’s version information.

Source

pub async fn clear_cache(&mut self) -> WarningResult<(), W>

Clears the neural network cache.

Source

pub async fn terminate( &mut self, progress: &AnalysisProgress, ) -> WarningResult<(), W>

Terminates the analysis for a single position.

progress may still be used to wait for the final result.

Source

pub async fn terminate_game( &mut self, progress: &GameAnalysisProgress, ) -> WarningResult<(), W>

Terminates the analysis for all positions in a game.

progress may still be used to wait for the final results.

Source

pub async fn terminate_positions( &mut self, progress: &GameAnalysisProgress, turn_numbers: Vec<usize>, ) -> WarningResult<(), W>

Terminates the analysis for the specified positions in a game.

progress may still be used to wait for the final results.

Source

pub async fn terminate_all(&mut self) -> WarningResult<(), W>

Terminates all pending analysis requests.

Source

pub async fn terminate_all_positions( &mut self, turn_numbers: Vec<usize>, ) -> WarningResult<(), W>

Terminates all pending analysis requests for the specified positions.

Source

pub async fn query_models(&mut self) -> WarningResult<Vec<Model>, W>

Requests information about the available neural network models.

Trait Implementations§

Source§

impl<W: WarningHandling> Debug for Analyzer<W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<W: WarningHandling + Default + Clone + 'static> From<Engine> for Analyzer<W>

Source§

fn from(engine: Engine) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.