Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
- Copyright (C) 2015-2017 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
+ Copyright (C) 2015-2018 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
else
ratio *= 1.5;
+ if (movesToGo > 1)
+ ratio = std::min(0.75, ratio);
+
ratio *= 1 + inc / (myTime * 8.5);
}
// Otherwise we increase usage of remaining time as the game goes on
int time = int(std::min(1.0, ratio) * std::max(0, myTime - moveOverhead));
if (type == OptimumTime && ponder)
- time *= 1.25;
-
- if (type == MaxTime)
- time -= 10; // Keep always at least 10 millisecs on the clock
+ time = 5 * time / 4;
- return std::max(0, time);
+ return time;
}
} // namespace