- // Read uci parameters
- int emergencyMoveHorizon = Options["Emergency Move Horizon"];
- int emergencyBaseTime = Options["Emergency Base Time"];
- int emergencyMoveTime = Options["Emergency Move Time"];
- int minThinkingTime = Options["Minimum Thinking Time"];
- int slowMover = Options["Slow Mover"];
-
- // Initialize unstablePvFactor to 1 and search times to maximum values
- unstablePvFactor = 1;
- optimumSearchTime = maximumSearchTime = std::max(limits.time[us], minThinkingTime);
-
- // We calculate optimum time usage for different hypothetical "moves to go"-values and choose the
- // minimum of calculated search time values. Usually the greatest hypMTG gives the minimum values.
- for (hypMTG = 1; hypMTG <= (limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon); ++hypMTG)
+ // x basetime (+ z increment)
+ // If there is a healthy increment, timeLeft can exceed actual available
+ // game time for the current move, so also cap to 20% of available game time.
+ if (limits.movestogo == 0)