Skip to main content

AnalysisRequest

Struct AnalysisRequest 

Source
pub struct AnalysisRequest {
Show 24 fields pub rules: Rules, pub komi: Option<f64>, pub white_handicap_bonus: Option<Bonus>, pub board_x_size: u8, pub board_y_size: u8, pub initial_stones: Option<Vec<(Player, Coord)>>, pub initial_player: Option<Player>, pub moves: Vec<(Player, Move)>, pub max_visits: Option<u32>, pub root_policy_temperature: Option<f64>, pub root_fpu_reduction_max: Option<f64>, pub analysis_pv_len: Option<usize>, pub include_ownership: bool, pub include_ownership_stdev: bool, pub include_moves_ownership: bool, pub include_moves_ownership_stdev: bool, pub include_policy: bool, pub include_pv_visits: bool, pub include_no_result_value: bool, pub avoid_moves: Option<Vec<RestrictedMoves>>, pub allow_moves: Option<Vec<RestrictedMoves>>, pub override_settings: Option<Config>, pub report_during_search_every: Option<f64>, pub priority: Option<i32>,
}
Expand description

A game record to be analyzed, along with analysis settings.

Fields§

§rules: Rules

The ruleset for this game.

§komi: Option<f64>

The komi for this game.

§white_handicap_bonus: Option<Bonus>

Bonus points white receives in handicap games.

§board_x_size: u8

The board width.

§board_y_size: u8

The board height.

§initial_stones: Option<Vec<(Player, Coord)>>

The stones on the board before the first move.

§initial_player: Option<Player>

The player to move in the initial position.

§moves: Vec<(Player, Move)>

The moves played in the game.

§max_visits: Option<u32>

The maximum number of visits to use.

§root_policy_temperature: Option<f64>

Root policy temperature.

§root_fpu_reduction_max: Option<f64>

Root FPU reduction max.

§analysis_pv_len: Option<usize>

The maximum length of the principal variation to return, not including the first move.

§include_ownership: bool

Whether to return the ownership prediction.

§include_ownership_stdev: bool

Whether to return the standard deviation of the ownership prediction.

§include_moves_ownership: bool

Whether to return the ownership prediction for each move.

§include_moves_ownership_stdev: bool

Whether to return the standard deviation of the ownership prediction for each move.

§include_policy: bool

Whether to return the neural network policy output.

§include_pv_visits: bool

Whether to return the number of visits for each position in the principal variation.

§include_no_result_value: bool

Whether to return the predicted probability that the game will have a void result.

§avoid_moves: Option<Vec<RestrictedMoves>>

Moves which are forbidden.

§allow_moves: Option<Vec<RestrictedMoves>>

Moves which are allowed. If specified, all other moves are forbidden.

§override_settings: Option<Config>

Config overrides for this request.

§report_during_search_every: Option<f64>

Report partial analysis results every this many seconds.

§priority: Option<i32>

The priority of this request.

Implementations§

Source§

impl AnalysisRequest

Source

pub fn new( rules: Rules, board_x_size: u8, board_y_size: u8, moves: Vec<(Player, Move)>, ) -> Self

Creates a new analysis request with the minimum required parameters.

Source

pub fn into_engine_request( self, id: String, analyze_turns: Vec<usize>, priorities: Option<Vec<i32>>, ) -> AnalysisRequest

Converts this request into the lower-level equivalent used by the engine module.

You probably don’t need to use this unless you’re directly using the lower-level API in the engine module.

Source

pub fn with_komi(self, komi: f64) -> Self

Sets komi.

Source

pub fn with_white_handicap_bonus(self, bonus: Bonus) -> Self

Sets white’s handicap bonus.

Source

pub fn with_initial_stones(self, initial_stones: Vec<(Player, Coord)>) -> Self

Sets the initial position before the first move.

Source

pub fn with_initial_player(self, initial_player: Player) -> Self

Sets the player to move in the initial position.

Source

pub fn with_max_visits(self, max_visits: u32) -> Self

Sets the maximum number of visits to use.

Source

pub fn with_root_policy_temperature(self, root_policy_temperature: f64) -> Self

Sets the root policy temperature.

Source

pub fn with_root_fpu_reduction_max(self, root_fpu_reduction_max: f64) -> Self

Sets the root FPU reduction max.

Source

pub fn with_analysis_pv_len(self, analysis_pv_len: usize) -> Self

Sets the maximum length of the principal variation to return, not including the first move.

Source

pub fn with_ownership(self) -> Self

Includes the ownership prediction.

Source

pub fn with_ownership_stdev(self) -> Self

Includes the standard deviation of the ownership prediction.

Source

pub fn with_moves_ownership(self) -> Self

Includes the ownership prediction for each move.

Source

pub fn with_moves_ownership_stdev(self) -> Self

Includes the standard deviation of the ownership prediction for each move.

Source

pub fn with_policy(self) -> Self

Includes the neural network policy output.

Source

pub fn with_pv_visits(self) -> Self

Includes the number of visits for each position in the principal variation.

Source

pub fn with_no_result_value(self) -> Self

Includes the predicted probability that the game will have a void result.

Source

pub fn with_avoid_moves(self, avoid_moves: Vec<RestrictedMoves>) -> Self

Sets moves which are forbidden.

Source

pub fn with_allow_moves(self, allow_moves: Vec<RestrictedMoves>) -> Self

Sets moves which are allowed.

Source

pub fn with_override_settings(self, config: Config) -> Self

Overrides config settings for this request.

Source

pub fn with_report_during_search_every(self, seconds: f64) -> Self

Gets partial analysis results every this many seconds.

Source

pub fn with_priority(self, priority: i32) -> Self

Sets the priority of this request.

Trait Implementations§

Source§

impl Clone for AnalysisRequest

Source§

fn clone(&self) -> AnalysisRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnalysisRequest

Source§

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

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

impl From<&SgfNode<Prop>> for AnalysisRequest

Available on crate feature sgf-parse only.
Source§

fn from(root: &SgfNode<Prop>) -> Self

Creates an analysis request from the root SgfNode of a game tree.

This will set rules, komi (if present), board_x_size, board_y_size, initial_stones (if present), initial_player (if present), and moves, based on the SGF data.

Rules are determined by the first of the following that applies:

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.