Code: Select all
const int HighDepth = 9; // Modify accordingly
if (currentdepth >= HighDepth) {
// At higher depths, the best move score will not change much
const int SmallerWindowSize = 30;
alpha = score - SmallerWindowSize;
beta = score + SmallerWindowSize;
} else {
const int WindowSize = 40;
alpha = std::max(score - WindowSize, -LARGE_NUMBER);
beta = std::min(score + WindowSize, LARGE_NUMBER);
}
In Stockfish, the idea is also not very difficult to implement:
Code: Select all
if (depth >= 5)
{
if (depth >= 15*ONE_PLY) // Relatively high depth
{
delta = Value(10);
alpha = std::max(RootMoves[PVIdx].prevScore - delta,-VALUE_INFINITE);
beta = std::min(RootMoves[PVIdx].prevScore + delta, VALUE_INFINITE);
}
else
{ // Depth < 15, use wider delta
delta = Value(16);
alpha = std::max(RootMoves[PVIdx].prevScore - delta,-VALUE_INFINITE);
beta = std::min(RootMoves[PVIdx].prevScore + delta, VALUE_INFINITE);
}
}
What do you say?
