]> git.sesse.net Git - stockfish/blobdiff - src/timeman.cpp
Revert "Fix random moves when time < 10ms"
[stockfish] / src / timeman.cpp
index e1b3d4e641e43a2e7e25e95c92904b50d9feeca4..bdcaee84c5f4ce10bc75198993ed6c6d315d0d30 100644 (file)
@@ -29,7 +29,7 @@ namespace {
   /// Constants
 
   const int MoveHorizon  = 50;    // Plan time management at most this many moves ahead
-  const float MaxRatio   = 3.0f;  // When in trouble, we can step over reserved time with this ratio
+  const float MaxRatio   = 7.0f;  // When in trouble, we can step over reserved time with this ratio
   const float StealRatio = 0.33f; // However we must not steal time from remaining moves over this ratio
 
 
@@ -76,10 +76,9 @@ namespace {
 }
 
 
-void TimeManager::pv_instability(int curChanges, int prevChanges) {
+void TimeManager::pv_instability(float bestMoveChanges) {
 
-  unstablePVExtraTime =  curChanges  * (optimumSearchTime / 2)
-                       + prevChanges * (optimumSearchTime / 3);
+  unstablePVExtraTime = int(bestMoveChanges * optimumSearchTime);
 }