implemented aspiration windows
This commit is contained in:
1 parent
2db16722f6
commit
4da9654e53
2 files changed
+20
-1
No files matched your search
+19
-1
@@ -252,10 +252,28 @@ static SearchResults ID(Board &board, SearchParams params) {
|
||||
SearchResults safeResults;
|
||||
safeResults.score = -inf;
|
||||
|
||||
int alpha = -inf;
|
||||
int beta = inf;
|
||||
|
||||
for (int depth = 1; depth <= 99; depth++) {
|
||||
timeToSearch = (fullTime / 20) + (inc / 2);
|
||||
|
||||
SearchResults currentResults = PVS(board, depth, -inf, inf);
|
||||
SearchResults currentResults = PVS(board, depth, alpha, beta);
|
||||
|
||||
// If we fell outside the window, try again with full width
|
||||
if ((currentResults.score <= alpha)
|
||||
|| (currentResults.score >= beta)) {
|
||||
alpha = -inf;
|
||||
beta = inf;
|
||||
depth--;
|
||||
|
||||
if (searchStopped) break;
|
||||
continue;
|
||||
}
|
||||
|
||||
alpha = currentResults.score - aspWinConst;
|
||||
beta = currentResults.score + aspWinConst;
|
||||
|
||||
if (currentResults.bestMove) {
|
||||
safeResults = currentResults;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ extern bool benchStarted;
|
||||
constexpr int invalidEntry = 111111;
|
||||
constexpr int inf = 100000;
|
||||
|
||||
constexpr int aspWinConst = 50;
|
||||
|
||||
class SearchResults {
|
||||
public:
|
||||
|
||||
Reference in new issue
Block a user