pub struct Computer {
    pub search_depth: usize,
    pub team: Team,
    pub last_node_count: usize,
    pub perfect_chance: f64,
}
Expand description

Root-level structure for managing the game as a collection of board states

Fields

search_depth: usizeteam: Teamlast_node_count: usizeperfect_chance: f64

Implementations

Get vector of available moves for a given board

Generate tree of boards to given search depth, return root node

Propagate scores up the tree employing MiniMax algorithm

Get best of given scores for given team

For given NodeIDs, insert score of board into tree Used for leaf nodes ready for propagating up tree

Traverse tree from given root ID and get NodeIDs of leaf nodes (those without children)

Expand all given nodes and return newly inserted layer of nodes

Insert all possible next boards as children of given board node

Insert given boards into tree

Get all possible next boards from given board

Get a new board based on the given using MiniMax to make decisions

Get a random board from possible node IDs and associated tree

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.