mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-18 08:07:08 +08:00
Restore startpos_ply_counter() instead of full_moves()
And pass correct currentPly to TimeManager::init(). This restores old behaviour, in particular now black has a different timing than white becuase is no more: currentPly = 2 * fullMoveNumber; but becomes 2 * (fullMoves - 1) + int(sideToMove == BLACK) No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -83,7 +83,7 @@ void TimeManager::pv_instability(int curChanges, int prevChanges) {
|
||||
}
|
||||
|
||||
|
||||
void TimeManager::init(const SearchLimits& limits, int fullMoveNumber)
|
||||
void TimeManager::init(const SearchLimits& limits, int currentPly)
|
||||
{
|
||||
/* We support four different kind of time controls:
|
||||
|
||||
@@ -124,8 +124,8 @@ void TimeManager::init(const SearchLimits& limits, int fullMoveNumber)
|
||||
|
||||
hypMyTime = Max(hypMyTime, 0);
|
||||
|
||||
t1 = minThinkingTime + remaining<OptimumTime>(hypMyTime, hypMTG, fullMoveNumber);
|
||||
t2 = minThinkingTime + remaining<MaxTime>(hypMyTime, hypMTG, fullMoveNumber);
|
||||
t1 = minThinkingTime + remaining<OptimumTime>(hypMyTime, hypMTG, currentPly);
|
||||
t2 = minThinkingTime + remaining<MaxTime>(hypMyTime, hypMTG, currentPly);
|
||||
|
||||
optimumSearchTime = Min(optimumSearchTime, t1);
|
||||
maximumSearchTime = Min(maximumSearchTime, t2);
|
||||
@@ -142,12 +142,11 @@ void TimeManager::init(const SearchLimits& limits, int fullMoveNumber)
|
||||
namespace {
|
||||
|
||||
template<TimeType T>
|
||||
int remaining(int myTime, int movesToGo, int fullMoveNumber)
|
||||
int remaining(int myTime, int movesToGo, int currentPly)
|
||||
{
|
||||
const float TMaxRatio = (T == OptimumTime ? 1 : MaxRatio);
|
||||
const float TStealRatio = (T == OptimumTime ? 0 : StealRatio);
|
||||
|
||||
int currentPly = 2 * fullMoveNumber;
|
||||
int thisMoveImportance = move_importance(currentPly);
|
||||
int otherMovesImportance = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user