1
0
Fork 0

Use slightly lower polling frequency in the last few seconds.

Instead of checking the time every 100 nodes in the last second,
and every 1000 nodes in the last five seconds, Stockfish now checks
every 1000 nodes in the last second and every 5000 nodes in the last
five seconds.  This was tested in 1036 games at a time control of
40 moves/10 seconds, and no losses on time occured.

Also fixed a bug pointed out by Marco:  In infinite mode, myTime
is actually 0, but of course we still don't want to check the time
more frequently than the standard once per 30000 nodes in this
case.
sf_2.3.1_base
Tord Romstad 2009-10-08 08:55:25 +02:00
parent 8dd01fda12
commit 225dcfeeb7
1 changed files with 4 additions and 2 deletions

View File

@ -471,10 +471,12 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
NodesBetweenPolls = Min(MaxNodes, 30000);
InfiniteSearch = true; // HACK
}
else if (InfiniteSearch)
NodesBetweenPolls = 30000;
else if (myTime < 1000)
NodesBetweenPolls = 100;
else if (myTime < 5000)
NodesBetweenPolls = 1000;
else if (myTime < 5000)
NodesBetweenPolls = 5000;
else
NodesBetweenPolls = 30000;