mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 15:37:47 +00:00
Simplify tm, removing faster 1st move and 1.13 extraTime.
Passed STC 10+0.1 : LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 349760 W: 90112 L: 90231 D: 169417 Ptnml(0-2): 784, 37970, 97496, 37841, 789 https://tests.stockfishchess.org/tests/view/665aeee00223e235f05b7d21 Passed LTC 60+0.6 : LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 140082 W: 35463 L: 35370 D: 69249 Ptnml(0-2): 59, 13492, 42851, 13575, 64 https://tests.stockfishchess.org/tests/view/665b15e78da109e362924e5a closes https://github.com/official-stockfish/Stockfish/pull/5334 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
180cab4438
commit
b009c43254
+4
-14
@@ -48,7 +48,6 @@ void TimeManagement::init(Search::LimitsType& limits,
|
||||
Color us,
|
||||
int ply,
|
||||
const OptionsMap& options,
|
||||
int& originalPly,
|
||||
double& originalTimeAdjust) {
|
||||
TimePoint npmsec = TimePoint(options["nodestime"]);
|
||||
|
||||
@@ -60,9 +59,6 @@ void TimeManagement::init(Search::LimitsType& limits,
|
||||
if (limits.time[us] == 0)
|
||||
return;
|
||||
|
||||
if (originalPly == -1)
|
||||
originalPly = ply;
|
||||
|
||||
TimePoint moveOverhead = TimePoint(options["Move Overhead"]);
|
||||
|
||||
// optScale is a percentage of available time to use for the current move.
|
||||
@@ -104,20 +100,14 @@ void TimeManagement::init(Search::LimitsType& limits,
|
||||
TimePoint timeLeft = std::max(TimePoint(1), limits.time[us] + limits.inc[us] * (mtg - 1)
|
||||
- moveOverhead * (2 + mtg));
|
||||
|
||||
// Extra time according to timeLeft
|
||||
if (originalTimeAdjust < 0)
|
||||
originalTimeAdjust = 0.2078 + 0.1623 * std::log10(timeLeft);
|
||||
|
||||
// x basetime (+ z increment)
|
||||
// If there is a healthy increment, timeLeft can exceed the actual available
|
||||
// game time for the current move, so also cap to a percentage of available game time.
|
||||
if (limits.movestogo == 0)
|
||||
{
|
||||
// Use extra time with larger increments
|
||||
double optExtra = scaledInc < 500 ? 1.0 : 1.13;
|
||||
if (ply - originalPly < 2)
|
||||
optExtra *= 0.95;
|
||||
optExtra *= originalTimeAdjust;
|
||||
// Extra time according to timeLeft
|
||||
if (originalTimeAdjust < 0)
|
||||
originalTimeAdjust = 0.3285 * std::log10(timeLeft) - 0.4830;
|
||||
|
||||
// Calculate time constants based on current time left.
|
||||
double logTimeInSec = std::log10(scaledTime / 1000.0);
|
||||
@@ -126,7 +116,7 @@ void TimeManagement::init(Search::LimitsType& limits,
|
||||
|
||||
optScale = std::min(0.0122 + std::pow(ply + 2.95, 0.462) * optConstant,
|
||||
0.213 * limits.time[us] / timeLeft)
|
||||
* optExtra;
|
||||
* originalTimeAdjust;
|
||||
|
||||
maxScale = std::min(6.64, maxConstant + ply / 12.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user