increasing delta expontentially if we fell out of window
This commit is contained in:
1 parent
4da9654e53
commit
1e548d3bd5
2 files changed
+10
-6
No files matched your search
+10
-4
@@ -255,6 +255,8 @@ static SearchResults ID(Board &board, SearchParams params) {
|
|||||||
int alpha = -inf;
|
int alpha = -inf;
|
||||||
int beta = 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);
|
||||||
|
|
||||||
@@ -263,16 +265,20 @@ static SearchResults ID(Board &board, SearchParams params) {
|
|||||||
// If we fell outside the window, try again with full width
|
// If we fell outside the window, try again with full width
|
||||||
if ((currentResults.score <= alpha)
|
if ((currentResults.score <= alpha)
|
||||||
|| (currentResults.score >= beta)) {
|
|| (currentResults.score >= beta)) {
|
||||||
alpha = -inf;
|
delta *= 2;
|
||||||
beta = inf;
|
|
||||||
|
alpha -= delta;
|
||||||
|
beta += delta;
|
||||||
|
|
||||||
depth--;
|
depth--;
|
||||||
|
|
||||||
if (searchStopped) break;
|
if (searchStopped) break;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha = currentResults.score - aspWinConst;
|
alpha = currentResults.score - delta;
|
||||||
beta = currentResults.score + aspWinConst;
|
beta = currentResults.score + delta;
|
||||||
|
delta = 50;
|
||||||
|
|
||||||
if (currentResults.bestMove) {
|
if (currentResults.bestMove) {
|
||||||
safeResults = currentResults;
|
safeResults = currentResults;
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ extern bool benchStarted;
|
|||||||
constexpr int invalidEntry = 111111;
|
constexpr int invalidEntry = 111111;
|
||||||
constexpr int inf = 100000;
|
constexpr int inf = 100000;
|
||||||
|
|
||||||
constexpr int aspWinConst = 50;
|
|
||||||
|
|
||||||
class SearchResults {
|
class SearchResults {
|
||||||
public:
|
public:
|
||||||
int score = 0;
|
int score = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user