X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftimeman.cpp;h=3236b6e9bbb46ec15ad353607cba1a1a4dc8835c;hb=a0e2debe3f1d14f84984a9a2c1482dc41f695548;hp=fc4fbaacd46ea894eb3661fed4389bc6f0fda890;hpb=c4d67d77c99b99c9ac387ab622773a320f8d5cc3;p=stockfish diff --git a/src/timeman.cpp b/src/timeman.cpp index fc4fbaac..3236b6e9 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -24,6 +24,8 @@ #include "timeman.h" #include "uci.h" +namespace Stockfish { + TimeManagement Time; // Our global time management object @@ -92,6 +94,16 @@ 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; } + +} // namespace Stockfish