|
My Project
|
#include "search.h"#include "bit.h"#include "options.h"#include "stats.h"#include "util.h"#include "ybwc.h"#include "settings.h"#include <stdlib.h>#include <assert.h>Go to the source code of this file.
Functions | |
| void | pv_debug (Search *search, const Move *bestmove, FILE *f) |
| Debug PV. | |
| bool | is_pv_ok (Search *search, int bestmove, int search_depth) |
| Check if PV is ok. | |
| static int | guess_move (Search *search, Board *board) |
| Guess a move. | |
| void | record_best_move (Search *search, const Board *init_board, const Move *bestmove, const int alpha, const int beta, const int depth) |
| Record best move. | |
| void | show_current_move (FILE *f, Search *search, const Move *move, const int alpha, const int beta, const bool parallel) |
| int | search_bound (const Search *search, int score) |
| bound root scores according to stable squares | |
| static int | search_route_PVS (Search *search, int alpha, int beta, const int depth, Node *node) |
| Reroute the PVS between midgame,endgame or terminal PVS. | |
| int | search_get_pv_cost (Search *search) |
| Compute a cost as a combination of node count, depth, etc. from hash_table. | |
| int | PVS_root (Search *search, const int alpha, const int beta, const int depth) |
| Principal Variation Search algorithm at the root of the tree. | |
| int | aspiration_search (Search *search, int alpha, int beta, const int depth, int score) |
| Aspiration window. | |
| static bool | get_last_level (Search *search, int *depth, int *selectivity) |
| Retrieve the last level of the search. | |
| void | iterative_deepening (Search *search, int alpha, int beta) |
| Iterative deepening. | |
| void * | search_run (void *v) |
| Search the bestmove of a given board. | |
Variables | |
| Log | search_log [1] |
| Log | engine_log [1] |
| int aspiration_search | ( | Search * | search, |
| int | alpha, | ||
| int | beta, | ||
| const int | depth, | ||
| int | score ) |
Aspiration window.
| search | Search. |
| alpha | Alpha bound. |
| beta | Beta bound. |
| depth | Depth. |
| score | Previous score. |
|
static |
Retrieve the last level of the search.
| search | Search. |
| depth | Depth of the last search. |
| selectivity | Selectivity of the last search. |
Guess a move.
this function is used when no move is found in the position retrieved from the hash table, meaning a fail-low search without a good move happened. A move is guessed after a "shallow search".
| bool is_pv_ok | ( | Search * | search, |
| int | bestmove, | ||
| int | search_depth ) |
Check if PV is ok.
| search | Search. |
| bestmove | Best move. |
| search_depth | Depth. |
| void iterative_deepening | ( | Search * | search, |
| int | alpha, | ||
| int | beta ) |
Debug PV.
| search | Search. |
| bestmove | Best move. |
| f | Output stream. |
| int PVS_root | ( | Search * | search, |
| const int | alpha, | ||
| const int | beta, | ||
| const int | depth ) |
Principal Variation Search algorithm at the root of the tree.
this function solves the position provided within the limits set by the alpha and beta bounds. The movelist parameter is updated so that the bestmove is the first of the list when the search ended.
| search | Search. |
| alpha | Alpha bound. |
| beta | Beta bound. |
| depth | Remaining depth. |
| int search_bound | ( | const Search * | search, |
| int | score ) |
bound root scores according to stable squares
| search | Position to search. |
| score | score to bound. |
| int search_get_pv_cost | ( | Search * | search | ) |
Compute a cost as a combination of node count, depth, etc. from hash_table.
The board is supposed to be updated by a move after the root position.
| search | Search. |
| void * search_run | ( | void * | v | ) |
Search the bestmove of a given board.
this is a function runable within its own thread. The board is supposed to have been set (by search_set_board()), and all search options (level, time, etc.) too. this function proceeds to some internal initialisations and then call the iterative deepening function, from where the search is actually done. After the search ends, some finalizations are done before the function returns.
| v | Search cast as void. |
| void show_current_move | ( | FILE * | f, |
| Search * | search, | ||
| const Move * | move, | ||
| const int | alpha, | ||
| const int | beta, | ||
| const bool | parallel ) |
|
extern |
|
extern |