Struct myopic_brain::EvalBoard[][src]

pub struct EvalBoard<B: ChessBoard> { /* fields omitted */ }

Implementations

impl EvalBoard<Board>[src]

pub fn start() -> EvalBoard<Board>[src]

pub fn builder_fen(fen: &str) -> Result<Builder<Board>>[src]

impl<B> EvalBoard<B> where
    B: ChessBoard
[src]

pub fn builder(board: B) -> Builder<B>[src]

Trait Implementations

impl<B: ChessBoard> ChessBoard for EvalBoard<B>[src]

fn make(&mut self, action: Move) -> Result<()>[src]

Evolves the position by making the given move. If the source hash of the move does not match the hash of this position (prior to making the move) then an error will be returned. If the hash matches but the move is illegal in this position (e.g if you manually start creating moves) then the results are undefined. Read more

fn unmake(&mut self) -> Result<Move>[src]

Reverses and returns the move which was made last. If no move has been made yet then an error is returned. Read more

fn compute_moves(&mut self, computation_type: MoveComputeType) -> Vec<Move>[src]

Compute a vector of all the legal moves in this position for the given computation type. Note there is no particular ordering to the move vector. Read more

fn termination_status(&mut self) -> Option<Termination>[src]

Compute the termination state of this node. If it is not terminal nothing is returned, if it is then the manner of termination is returned wrapped inside an Option. The termination can be only a draw or a loss since a side only loses when it runs out of moves, i.e. you don’t play a winning move, you just fail to have a legal move. Read more

fn in_check(&mut self) -> bool[src]

Determines whether the active side is in a state of check.

fn side(&self, side: Side) -> BitBoard[src]

Return the locations of all pieces on the given side.

fn sides(&self) -> (BitBoard, BitBoard)[src]

Return the locations of all white and black pieces.

fn hash(&self) -> u64[src]

Returns the Zobrist hash of this position.

fn active(&self) -> Side[src]

Return the active side in this position, i.e. the one whose turn it is.

fn enpassant(&self) -> Option<Square>[src]

Return the enpassant target square in this position.

fn locs(&self, pieces: &[Piece]) -> BitBoard[src]

Return the locations of the given pieces.

fn king(&self, side: Side) -> Square[src]

Return the location of the king for the given side.

fn piece(&self, location: Square) -> Option<Piece>[src]

Return the piece occupying the given location.

fn half_move_clock(&self) -> usize[src]

Return the half move clock value at this position.

fn position_count(&self) -> usize[src]

Return the number of previous positions for this board.

fn remaining_rights(&self) -> EnumSet<CastleZone>[src]

Return the remaining castling rights from this position.

fn play_pgn(&mut self, moves: &str) -> Result<Vec<Move>>[src]

Parse the given string as a sequence of pgn encoded moves starting from the current position. The moves are then made one by one. The sequence of moves which were made are returned in a Vec. Read more

fn play_uci(&mut self, moves: &str) -> Result<Vec<Move>>[src]

Parse the given string as a sequence of uci encoded moves starting from the current position. The moves are then made one by one.The sequence of moves which were made are returned in a Vec. Read more

fn parse_uci(&mut self, uci_move: &str) -> Result<Move>[src]

Given a uci encoded move this method will attempt to match it to the unique matching legal move in this position if it exist. An error is returned if no matching move exists in this position. Read more

fn to_partial_fen(&self, cmps: &[FenComponent]) -> String[src]

Return the specified components of the FEN encoding of this position in the given order with components separated by a space. Read more

fn to_fen(&self) -> String[src]

Return the complete FEN representation of this position.

fn all_pieces(&self) -> BitBoard[src]

Returns the locations of all pieces on the board.

impl<B: Clone + ChessBoard> Clone for EvalBoard<B>[src]

fn clone(&self) -> EvalBoard<B>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<B: ChessBoard> EvalChessBoard for EvalBoard<B>[src]

fn static_eval(&mut self) -> i32[src]

The static evaluation function assigns a score to this exact position at the point of time it is called. It does not take into account potential captures/recaptures etc. It must follow the rule that ‘a higher score is best for the active side’. That is if it is white to move next then a high positive score indicates a favorable position for white and if it is black to move a high positive score indicates a favorable position for black. If the state it terminal it must return the LOSS_VALUE or DRAW_VALUE depending on the type of termination. Read more

fn piece_values(&self) -> &[i32; 6][src]

The value each piece is considered to have in the current state of the game. Read more

fn positional_eval(&self, piece: Piece, location: Square) -> i32[src]

The positional (table) value of the given piece situated at the given square in the context of this position. Read more

Auto Trait Implementations

impl<B> RefUnwindSafe for EvalBoard<B> where
    B: RefUnwindSafe

impl<B> Send for EvalBoard<B>

impl<B> Sync for EvalBoard<B> where
    B: Sync

impl<B> Unpin for EvalBoard<B> where
    B: Unpin

impl<B> UnwindSafe for EvalBoard<B> where
    B: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T

Notable traits for &'_ mut I

impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

Notable traits for &'_ mut I

impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.