Merge pull request #32 from rektdie/soft_tm

added soft tm | bench 902872
This commit was merged in pull request #32.
This commit is contained in:
rektdie authored and GitHub committed 2025-03-26 01:33:01 +01:00
commit 03cc40bda3
1 file changed
+9 -1
+9 -1
View File
@@ -318,6 +318,7 @@ static SearchResults ID(Board &board, SearchParams params) {
for (int depth = 1; depth <= 99; depth++) {
timeToSearch = (fullTime / 20) + (inc / 2);
int softTime = timeToSearch * 0.65;
SearchResults currentResults = PVS<true>(board, depth, alpha, beta, ply);
@@ -343,7 +344,14 @@ static SearchResults ID(Board &board, SearchParams params) {
safeResults = currentResults;
}
if (searchStopped) break;
if (searchStopped) {
break;
} else {
if (sw.GetElapsedMS() >= softTime) {
StopSearch();
break;
}
}
std::cout << "info ";
std::cout << "depth " << depth;