#include "search.h"
#include "timeman.h"
-#include "ucioption.h"
+#include "uci.h"
namespace {
double ratio1 = (TMaxRatio * thisMoveImportance) / (TMaxRatio * thisMoveImportance + otherMovesImportance);
double ratio2 = (thisMoveImportance + TStealRatio * otherMovesImportance) / (thisMoveImportance + otherMovesImportance);
- return int(floor(myTime * std::min(ratio1, ratio2)));
+ return int(myTime * std::min(ratio1, ratio2));
}
} // namespace
increment > 0 && movesToGo == 0 means: x basetime + z increment
increment > 0 && movesToGo != 0 means: x moves in y minutes + z increment
- Time management is adjusted by following UCI parameters:
+ Time management is adjusted by following parameters:
emergencyMoveHorizon: Be prepared to always play at least this many moves
emergencyBaseTime : Always attempt to keep at least this much time (in ms) at clock
int hypMTG, hypMyTime, t1, t2;
// 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"];
+ int moveOverhead = Options["Move Overhead"];
+ int minThinkingTime = Options["Minimum Thinking Time"];
+ int slowMover = Options["Slow Mover"];
// Initialize unstablePvFactor to 1 and search times to maximum values
unstablePvFactor = 1;
// Calculate thinking time for hypothetical "moves to go"-value
hypMyTime = limits.time[us]
+ limits.inc[us] * (hypMTG - 1)
- - emergencyBaseTime
- - emergencyMoveTime * std::min(hypMTG, emergencyMoveHorizon);
+ - moveOverhead * (2 + std::min(hypMTG, 40));
hypMyTime = std::max(hypMyTime, 0);