#include "search.h"
#include "bit.h"
#include "settings.h"
#include "stats.h"
#include "ybwc.h"
#include <assert.h>
Go to the source code of this file.
|
| static int | board_solve (const Board *board, const int n_empties) |
| | Get the final score.
|
| |
| int | search_solve (const Search *search) |
| | Get the final score.
|
| |
| static int | board_solve_0 (const Board *board) |
| | Get the final score.
|
| |
| int | search_solve_0 (const Search *search) |
| | Get the final score.
|
| |
| int | board_score_1 (const Board *board, const int beta, const int x) |
| | Get the final score.
|
| |
| static int | board_solve_2 (Board *board, int alpha, const int x1, const int x2, Search *search) |
| | Get the final score.
|
| |
| static int | search_solve_3 (Search *search, const int alpha) |
| | Get the final score.
|
| |
| static int | search_solve_4 (Search *search, const int alpha) |
| | Get the final score.
|
| |
| static int | search_shallow (Search *search, const int alpha) |
| | Evaluate a position using a shallow NWS.
|
| |
| int | NWS_endgame (Search *search, const int alpha) |
| | Evaluate an endgame position with a Null Window Search algorithm.
|
| |
Search near the end of the game.
- Date
- 1998 - 2017
- Author
- Richard Delorme
- Version
- 4.4
◆ board_score_1()
| int board_score_1 |
( |
const Board * | board, |
|
|
const int | beta, |
|
|
const int | x ) |
|
inline |
Get the final score.
Get the final score, when 1 empty squares remain. The following code has been adapted from Zebra by Gunnar Anderson.
- Parameters
-
| board | Board to evaluate. |
| beta | Beta bound. |
| x | Last empty square to play. |
- Returns
- The final opponent score, as a disc difference.
◆ board_solve()
| static int board_solve |
( |
const Board * | board, |
|
|
const int | n_empties ) |
|
inlinestatic |
Get the final score.
Get the final score, when no move can be made.
- Parameters
-
| board | Board. |
| n_empties | Number of empty squares remaining on the board. |
- Returns
- The final score, as a disc difference.
◆ board_solve_0()
| static int board_solve_0 |
( |
const Board * | board | ) |
|
|
inlinestatic |
Get the final score.
Get the final score, when the board is full.
- Parameters
-
- Returns
- The final score, as a disc difference.
◆ board_solve_2()
| static int board_solve_2 |
( |
Board * | board, |
|
|
int | alpha, |
|
|
const int | x1, |
|
|
const int | x2, |
|
|
Search * | search ) |
|
static |
Get the final score.
Get the final score, when 2 empty squares remain.
- Parameters
-
| board | The board to evaluate. |
| alpha | Alpha bound. |
| x1 | First empty square coordinate. |
| x2 | Second empty square coordinate. |
| search | Search. |
- Returns
- The final score, as a disc difference.
◆ NWS_endgame()
| int NWS_endgame |
( |
Search * | search, |
|
|
const int | alpha ) |
Evaluate an endgame position with a Null Window Search algorithm.
This function is used when there are still many empty squares on the board. Move ordering, hash table cutoff, enhanced transposition cutoff, etc. are used in order to diminish the size of the tree to analyse, but at the expense of a slower speed.
- Parameters
-
| search | Search. |
| alpha | Alpha bound. |
- Returns
- The final score, as a disc difference.
◆ search_shallow()
| static int search_shallow |
( |
Search * | search, |
|
|
const int | alpha ) |
|
static |
Evaluate a position using a shallow NWS.
This function is used when there are few empty squares on the board. Here, optimizations are in favour of speed instead of efficiency. Move ordering is constricted to the hole parity and the type of squares. No hashtable are used and anticipated cut-off is limited to stability cut-off.
- Parameters
-
| search | Search. |
| alpha | Alpha bound. |
- Returns
- The final score, as a disc difference.
◆ search_solve()
| int search_solve |
( |
const Search * | search | ) |
|
Get the final score.
Get the final score, when no move can be made.
- Parameters
-
- Returns
- The final score, as a disc difference.
◆ search_solve_0()
| int search_solve_0 |
( |
const Search * | search | ) |
|
Get the final score.
Get the final score, when the board is full.
- Parameters
-
- Returns
- The final score, as a disc difference.
◆ search_solve_3()
| static int search_solve_3 |
( |
Search * | search, |
|
|
const int | alpha ) |
|
static |
Get the final score.
Get the final score, when 3 empty squares remain.
- Parameters
-
| search | Search. |
| alpha | Alpha bound. |
- Returns
- The final score, as a disc difference.
◆ search_solve_4()
| static int search_solve_4 |
( |
Search * | search, |
|
|
const int | alpha ) |
|
static |
Get the final score.
Get the final score, when 4 empty squares remain.
- Parameters
-
| search | Search position. |
| alpha | Upper score value. |
- Returns
- The final score, as a disc difference.