]> git.sesse.net Git - stockfish/blobdiff - src/timeman.cpp
Upon changing the number of threads, make sure all threads are bound
[stockfish] / src / timeman.cpp
index ea1e92d2aca5ca57ef0c6c2a6942ea2717d65753..0c5224642c191856bc458426597abdcee8e7edbb 100644 (file)
@@ -52,6 +52,9 @@ namespace {
         else
             ratio *= 1.5;
 
+        if (movesToGo > 1)
+            ratio = std::min(0.75, ratio);
+
         ratio *= 1 + inc / (myTime * 8.5);
     }
     // Otherwise we increase usage of remaining time as the game goes on
@@ -64,12 +67,9 @@ namespace {
     int time = int(std::min(1.0, ratio) * std::max(0, myTime - moveOverhead));
 
     if (type == OptimumTime && ponder)
-        time *= 1.25;
-
-    if (type == MaxTime)
-        time -= 10; // Keep always at least 10 millisecs on the clock
+        time = 5 * time / 4;
 
-    return std::max(0, time);
+    return time;
   }
 
 } // namespace