@@ -37,27 +37,25 @@ namespace {
3737 const double StealRatio = 0.35 ; // However we must not steal time from remaining moves over this ratio
3838
3939
40- // move_importance() is a skew-logistic function based on naive statistical
41- // analysis of "how many games are still undecided after n half-moves". Game
42- // is considered "undecided" as long as neither side has >275cp advantage.
43- // Data was extracted from the CCRL game database with some simple filtering criteria.
40+ // move_importance() is an exponential function based on naive observation
41+ // that a game is closer to be decided after each half-move. This function
42+ // should be decreasing and with "nice" convexity properties.
4443
4544 double move_importance (int ply) {
4645
47- const double XScale = 7.64 ;
48- const double XShift = 58.4 ;
49- const double Skew = 0.183 ;
46+ const double PlyScale = 109.3265 ;
47+ const double PlyGrowth = 4.0 ;
5048
51- return pow (( 1 + exp ((ply - XShift) / XScale)), -Skew ) + DBL_MIN; // Ensure non-zero
49+ return exp (- pow (ply / PlyScale, PlyGrowth) ) + DBL_MIN; // Ensure non-zero
5250 }
5351
5452 template <TimeType T>
55- int remaining (int myTime, int movesToGo, int ply, int slowMover )
53+ int remaining (int myTime, int movesToGo, int ply)
5654 {
5755 const double TMaxRatio = (T == OptimumTime ? 1 : MaxRatio);
5856 const double TStealRatio = (T == OptimumTime ? 0 : StealRatio);
5957
60- double moveImportance = ( move_importance (ply) * slowMover) / 100 ;
58+ double moveImportance = move_importance (ply);
6159 double otherMovesImportance = 0 ;
6260
6361 for (int i = 1 ; i < movesToGo; ++i)
@@ -85,7 +83,6 @@ void TimeManagement::init(Search::LimitsType& limits, Color us, int ply)
8583{
8684 int minThinkingTime = Options[" Minimum Thinking Time" ];
8785 int moveOverhead = Options[" Move Overhead" ];
88- int slowMover = Options[" Slow Mover" ];
8986 int npmsec = Options[" nodestime" ];
9087
9188 // If we have to play in 'nodes as time' mode, then convert from time
@@ -120,8 +117,8 @@ void TimeManagement::init(Search::LimitsType& limits, Color us, int ply)
120117
121118 hypMyTime = std::max (hypMyTime, 0 );
122119
123- int t1 = minThinkingTime + remaining<OptimumTime>(hypMyTime, hypMTG, ply, slowMover );
124- int t2 = minThinkingTime + remaining<MaxTime >(hypMyTime, hypMTG, ply, slowMover );
120+ int t1 = minThinkingTime + remaining<OptimumTime>(hypMyTime, hypMTG, ply);
121+ int t2 = minThinkingTime + remaining<MaxTime >(hypMyTime, hypMTG, ply);
125122
126123 optimumTime = std::min (t1, optimumTime);
127124 maximumTime = std::min (t2, maximumTime);
0 commit comments