X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftimeman.cpp;h=e05c4626f31723c65593c6f995306708414de99a;hp=046b3aaf70c769e03adcd7668445399eabeeebf7;hb=7733dadfd7c8781e3bde3cc4e21751fa44ab6ed8;hpb=c295599e4ad481f677b14cb0be14174b61ebff81 diff --git a/src/timeman.cpp b/src/timeman.cpp index 046b3aaf..e05c4626 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -88,13 +88,13 @@ namespace { //// 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: @@ -119,7 +119,8 @@ void TimeManager::update(int myTime, int myInc, int movesToGo, int currentPly) int emergencyMoveTime = get_option_value_int("Emergency Move Time"); int minThinkingTime = get_option_value_int("Minimum Thinking Time"); - // 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