Skip to content

Commit 77fa960

Browse files
IIveczamar
authored andcommitted
Remove slowMover
Removes a slowMover and one paramater from move_importance function. STC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 77023 W: 14456 L: 14433 D: 48134 LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 37175 W: 5190 L: 5092 D: 26893 Resolves official-stockfish#589
1 parent bfe9044 commit 77fa960

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/timeman.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

src/ucioption.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void init(OptionsMap& o) {
6767
o["Skill Level"] << Option(20, 0, 20);
6868
o["Move Overhead"] << Option(30, 0, 5000);
6969
o["Minimum Thinking Time"] << Option(20, 0, 5000);
70-
o["Slow Mover"] << Option(89, 10, 1000);
7170
o["nodestime"] << Option(0, 0, 10000);
7271
o["UCI_Chess960"] << Option(false);
7372
o["SyzygyPath"] << Option("<empty>", on_tb_path);

0 commit comments

Comments
 (0)