pub struct AnalysisRequest {Show 27 fields
pub id: String,
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, String)>>,
pub initial_player: Option<Player>,
pub moves: Vec<(Player, String)>,
pub analyze_turns: Option<Vec<usize>>,
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>,
pub priorities: Option<Vec<i32>>,
}Expand description
A game record to be analyzed, along with analysis settings.
Fields§
§id: StringThe request ID.
rules: RulesThe 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: u8The board width.
board_y_size: u8The board height.
initial_stones: Option<Vec<(Player, String)>>The stones on the board before the first move.
initial_player: Option<Player>The player to move in the initial position.
moves: Vec<(Player, String)>The moves played in the game. Move locations can be in GTP format ("A1", "pass", etc.) or explicit
coordinates ("(0,0)").
analyze_turns: Option<Vec<usize>>The positions to analyze, where 0 is the position before the first move. If not provided, only the final position will be analyzed. The engine will return a separate response for each position.
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: boolWhether to return the ownership prediction.
include_ownership_stdev: boolWhether to return the standard deviation of the ownership prediction.
include_moves_ownership: boolWhether to return the ownership prediction for each move.
include_moves_ownership_stdev: boolWhether to return the standard deviation of the ownership prediction for each move.
include_policy: boolWhether to return the neural network policy output.
include_pv_visits: boolWhether to return the number of visits for each position in the principal variation.
include_no_result_value: boolWhether 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.
priorities: Option<Vec<i32>>The priorities of each position to analyze.
Implementations§
Source§impl AnalysisRequest
impl AnalysisRequest
Sourcepub fn new(
id: String,
rules: Rules,
board_x_size: u8,
board_y_size: u8,
moves: Vec<(Player, String)>,
) -> Self
pub fn new( id: String, rules: Rules, board_x_size: u8, board_y_size: u8, moves: Vec<(Player, String)>, ) -> Self
Creates a new analysis request with the minimum required parameters.
Sourcepub fn with_white_handicap_bonus(self, bonus: Bonus) -> Self
pub fn with_white_handicap_bonus(self, bonus: Bonus) -> Self
Sets white’s handicap bonus.
Sourcepub fn with_initial_stones(self, initial_stones: Vec<(Player, String)>) -> Self
pub fn with_initial_stones(self, initial_stones: Vec<(Player, String)>) -> Self
Sets the initial position before the first move.
Sourcepub fn with_initial_player(self, initial_player: Player) -> Self
pub fn with_initial_player(self, initial_player: Player) -> Self
Sets the player to move in the initial position.
Sourcepub fn with_analyze_turns(self, analyze_turns: Vec<usize>) -> Self
pub fn with_analyze_turns(self, analyze_turns: Vec<usize>) -> Self
Analyzes the specified positions. The position before the first move is turn 0.
Sourcepub fn with_max_visits(self, max_visits: u32) -> Self
pub fn with_max_visits(self, max_visits: u32) -> Self
Sets the maximum number of visits to use.
Sourcepub fn with_root_policy_temperature(self, root_policy_temperature: f64) -> Self
pub fn with_root_policy_temperature(self, root_policy_temperature: f64) -> Self
Sets the root policy temperature.
Sourcepub fn with_root_fpu_reduction_max(self, root_fpu_reduction_max: f64) -> Self
pub fn with_root_fpu_reduction_max(self, root_fpu_reduction_max: f64) -> Self
Sets the root FPU reduction max.
Sourcepub fn with_analysis_pv_len(self, analysis_pv_len: usize) -> Self
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.
Sourcepub fn with_ownership(self) -> Self
pub fn with_ownership(self) -> Self
Includes the ownership prediction.
Sourcepub fn with_ownership_stdev(self) -> Self
pub fn with_ownership_stdev(self) -> Self
Includes the standard deviation of the ownership prediction.
Sourcepub fn with_moves_ownership(self) -> Self
pub fn with_moves_ownership(self) -> Self
Includes the ownership prediction for each move.
Sourcepub fn with_moves_ownership_stdev(self) -> Self
pub fn with_moves_ownership_stdev(self) -> Self
Includes the standard deviation of the ownership prediction for each move.
Sourcepub fn with_policy(self) -> Self
pub fn with_policy(self) -> Self
Includes the neural network policy output.
Sourcepub fn with_pv_visits(self) -> Self
pub fn with_pv_visits(self) -> Self
Includes the number of visits for each position in the principal variation.
Sourcepub fn with_no_result_value(self) -> Self
pub fn with_no_result_value(self) -> Self
Includes the predicted probability that the game will have a void result.
Sourcepub fn with_avoid_moves(self, avoid_moves: Vec<RestrictedMoves>) -> Self
pub fn with_avoid_moves(self, avoid_moves: Vec<RestrictedMoves>) -> Self
Sets moves which are forbidden.
Sourcepub fn with_allow_moves(self, allow_moves: Vec<RestrictedMoves>) -> Self
pub fn with_allow_moves(self, allow_moves: Vec<RestrictedMoves>) -> Self
Sets moves which are allowed.
Sourcepub fn with_override_settings(self, config: Config) -> Self
pub fn with_override_settings(self, config: Config) -> Self
Overrides config settings for this request.
Sourcepub fn with_report_during_search_every(self, seconds: f64) -> Self
pub fn with_report_during_search_every(self, seconds: f64) -> Self
Gets partial analysis results every this many seconds.
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Sets the priority of this request.
Sourcepub fn with_priorities(self, priorities: Vec<i32>) -> Self
pub fn with_priorities(self, priorities: Vec<i32>) -> Self
Sets the priorities of each position to analyze.
Trait Implementations§
Source§impl Clone for AnalysisRequest
impl Clone for AnalysisRequest
Source§fn clone(&self) -> AnalysisRequest
fn clone(&self) -> AnalysisRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more