- int minThinkingTime = Options["Minimum Thinking Time"];
- int moveOverhead = Options["Move Overhead"];
- 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);
-
- const int MaxMTG = limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon;
-
- // 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 (int hypMTG = 1; hypMTG <= MaxMTG; ++hypMTG)
+ int moveOverhead = Options["Move Overhead"];
+ int npmsec = Options["nodestime"];
+ bool ponder = Options["Ponder"];
+
+ // If we have to play in 'nodes as time' mode, then convert from time
+ // to nodes, and use resulting values in time management formulas.
+ // WARNING: Given npms (nodes per millisecond) must be much lower then
+ // the real engine speed to avoid time losses.
+ if (npmsec)