Aspiration windows #11
No files matched your search
+25
-1
@@ -252,10 +252,34 @@ static SearchResults ID(Board &board, SearchParams params) {
|
|||||||
SearchResults safeResults;
|
SearchResults safeResults;
|
||||||
safeResults.score = -inf;
|
safeResults.score = -inf;
|
||||||
|
|
||||||
|
int alpha = -inf;
|
||||||
|
int beta = inf;
|
||||||
|
|
||||||
|
int delta = 50;
|
||||||
|
|
||||||
for (int depth = 1; depth <= 99; depth++) {
|
for (int depth = 1; depth <= 99; depth++) {
|
||||||
timeToSearch = (fullTime / 20) + (inc / 2);
|
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)) {
|
||||||
|
delta *= 2;
|
||||||
|
|
||||||
|
alpha -= delta;
|
||||||
|
beta += delta;
|
||||||
|
|
||||||
|
depth--;
|
||||||
|
|
||||||
|
if (searchStopped) break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
alpha = currentResults.score - delta;
|
||||||
|
beta = currentResults.score + delta;
|
||||||
|
delta = 50;
|
||||||
|
|
||||||
if (currentResults.bestMove) {
|
if (currentResults.bestMove) {
|
||||||
safeResults = currentResults;
|
safeResults = currentResults;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ extern bool benchStarted;
|
|||||||
constexpr int invalidEntry = 111111;
|
constexpr int invalidEntry = 111111;
|
||||||
constexpr int inf = 100000;
|
constexpr int inf = 100000;
|
||||||
|
|
||||||
|
|
||||||
class SearchResults {
|
class SearchResults {
|
||||||
public:
|
public:
|
||||||
int score = 0;
|
int score = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user