]> git.sesse.net Git - stockfish/commitdiff
Distribute part of first move time to other moves
authorLeonid Pechenik <lp@home>
Thu, 20 Feb 2014 07:38:10 +0000 (08:38 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 20 Feb 2014 07:39:00 +0000 (08:39 +0100)
Passed both short TC:
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 18907 W: 3475 L: 3322 D: 12110

And long TC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 19044 W: 2997 L: 2811 D: 13236

bench: 8430785

src/search.cpp
src/search.h
src/timeman.h

index 0d1a401c6b715c489426047e308e60490fea203c..da22c5cff066f505ba5eed5537904fc0ed97d32b 100644 (file)
@@ -43,7 +43,7 @@ namespace Search {
   std::vector<RootMove> RootMoves;
   Position RootPos;
   Color RootColor;
-  Time::point SearchTime, IterationTime;
+  Time::point SearchTime;
   StateStackPtr SetupStates;
 }
 
@@ -397,7 +397,7 @@ namespace {
                 sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
         }
 
-        IterationTime = Time::now() - SearchTime;
+        Time::point iterationTime = Time::now() - SearchTime;
 
         // If skill levels are enabled and time is up, pick a sub-optimal best move
         if (skill.enabled() && skill.time_to_pick(depth))
@@ -432,7 +432,7 @@ namespace {
             // Stop the search if only one legal move is available or all
             // of the available time has been used.
             if (   RootMoves.size() == 1
-                || IterationTime > TimeMgr.available_time() )
+                || iterationTime > TimeMgr.available_time() )
                 stop = true;
 
             if (stop)
@@ -1627,8 +1627,7 @@ void check_time() {
   Time::point elapsed = Time::now() - SearchTime;
   bool stillAtFirstMove =    Signals.firstRootMove
                          && !Signals.failedLowAtRoot
-                         &&  elapsed > TimeMgr.available_time()
-                         &&  elapsed > IterationTime * 1.4;
+                         &&  elapsed > TimeMgr.available_time() * 75 / 100;
 
   bool noMoreTime =   elapsed > TimeMgr.maximum_time() - 2 * TimerThread::Resolution
                    || stillAtFirstMove;
index 2fd8d47d9860efcea1ac414ca13ece6bf63b2e4c..3752dd70b0fd492eddaf90ba8d1455249068a43e 100644 (file)
@@ -100,7 +100,7 @@ extern LimitsType Limits;
 extern std::vector<RootMove> RootMoves;
 extern Position RootPos;
 extern Color RootColor;
-extern Time::point SearchTime, IterationTime;
+extern Time::point SearchTime;
 extern StateStackPtr SetupStates;
 
 extern void init();
index 5a98f614f2318f580c5a3b0bdc8a6f15c94fa13c..90bd18679d5af6f42fd7abfe3c6a523c6817832b 100644 (file)
@@ -27,7 +27,7 @@ class TimeManager {
 public:
   void init(const Search::LimitsType& limits, int currentPly, Color us);
   void pv_instability(double bestMoveChanges);
-  int available_time() const { return int(optimumSearchTime * unstablePvFactor * 0.62); }
+  int available_time() const { return int(optimumSearchTime * unstablePvFactor * 0.71); }
   int maximum_time() const { return maximumSearchTime; }
 
 private: