//// Functions
////
-void TimeManager::best_move_changes(int curIter, int prevIter) {
+void TimeManager::pv_instability(int curChanges, int prevChanges) {
- extraSearchTime = curIter * (optimumSearchTime / 2)
- + prevIter * (optimumSearchTime / 3);
+ unstablePVExtraTime = curChanges * (optimumSearchTime / 2)
+ + prevChanges * (optimumSearchTime / 3);
}
-void TimeManager::update(int myTime, int myInc, int movesToGo, int currentPly)
+void TimeManager::init(int myTime, int myInc, int movesToGo, int currentPly)
{
/* We support four different kind of time controls:
int hypMTG, hypMyTime, t1, t2;
// Read uci parameters
- int emergencyMoveHorizon = get_option_value_int("Emergency Move Horizon");
- int emergencyBaseTime = get_option_value_int("Emergency Base Time");
- int emergencyMoveTime = get_option_value_int("Emergency Move Time");
- int minThinkingTime = get_option_value_int("Minimum Thinking Time");
+ int emergencyMoveHorizon = Options["Emergency Move Horizon"].value<int>();
+ int emergencyBaseTime = Options["Emergency Base Time"].value<int>();
+ int emergencyMoveTime = Options["Emergency Move Time"].value<int>();
+ int minThinkingTime = Options["Minimum Thinking Time"].value<int>();
- // Initialize variables to maximum values
+ // Initialize to maximum values but unstablePVExtraTime that is reset
+ unstablePVExtraTime = 0;
optimumSearchTime = maximumSearchTime = myTime;
// We calculate optimum time usage for different hypothetic "moves to go"-values and choose the
maximumSearchTime = Min(maximumSearchTime, t2);
}
- if (get_option_value_bool("Ponder"))
+ if (Options["Ponder"].value<bool>())
optimumSearchTime += optimumSearchTime / 4;
// Make sure that maxSearchTime is not over absoluteMaxSearchTime