]> git.sesse.net Git - stockfish/blobdiff - src/timeman.cpp
Change tempo with time and threads
[stockfish] / src / timeman.cpp
index f742d1e44221cd831022774a1163211812a81c56..3236b6e9bbb46ec15ad353607cba1a1a4dc8835c 100644 (file)
@@ -94,6 +94,14 @@ void TimeManagement::init(Search::LimitsType& limits, Color us, int ply) {
   optimumTime = TimePoint(optScale * timeLeft);
   maximumTime = TimePoint(std::min(0.8 * limits.time[us] - moveOverhead, maxScale * optimumTime));
 
+  if (Stockfish::Search::Limits.use_time_management())
+  {
+      int strength = std::log( std::max(1, int(optimumTime * Threads.size() / 10))) * 60;
+      tempoNNUE = std::clamp( (strength + 264) / 24, 18, 30);
+  }
+  else
+      tempoNNUE = 28; // default for no time given
+
   if (Options["Ponder"])
       optimumTime += optimumTime / 4;
 }