]> git.sesse.net Git - stockfish/commitdiff
Revert opponent time advantage logic
authorMarco Costalba <mcostalba@gmail.com>
Thu, 27 Nov 2008 06:42:57 +0000 (07:42 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 30 Nov 2008 18:23:33 +0000 (19:23 +0100)
Strength increase was due to an hidden bug introduced
by the patch, namely the time per move to /30 instead
of /40 (see previous patch).

After testing this feature do not add any substantial
increase so is removed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index bc66ebad15751eefb3b037ea9f446e455f11b4ef..d02035183b07a262abd14de260b6baee824aa332 100644 (file)
@@ -188,7 +188,7 @@ namespace {
   // Time managment variables
   int SearchStartTime;
   int MaxNodes, MaxDepth;
   // Time managment variables
   int SearchStartTime;
   int MaxNodes, MaxDepth;
-  int MaxSearchTime, AbsoluteMaxSearchTime, ExtraSearchTime, TimeAdvantage;
+  int MaxSearchTime, AbsoluteMaxSearchTime, ExtraSearchTime;
   Move BestRootMove, PonderMove, EasyMove;
   int RootMoveNumber;
   bool InfiniteSearch;
   Move BestRootMove, PonderMove, EasyMove;
   int RootMoveNumber;
   bool InfiniteSearch;
@@ -427,8 +427,6 @@ void think(const Position &pos, bool infinite, bool ponder, int side_to_move,
   int myIncrement = increment[side_to_move];
   int oppTime = time[1 - side_to_move];
 
   int myIncrement = increment[side_to_move];
   int oppTime = time[1 - side_to_move];
 
-  TimeAdvantage = myTime - oppTime;
-
   if (!movesToGo) // Sudden death time control
   {
       if (myIncrement)
   if (!movesToGo) // Sudden death time control
   {
       if (myIncrement)
@@ -680,10 +678,6 @@ namespace {
                 ExtraSearchTime = BestMoveChangesByIteration[Iteration]   * (MaxSearchTime / 2)
                                 + BestMoveChangesByIteration[Iteration-1] * (MaxSearchTime / 3);
 
                 ExtraSearchTime = BestMoveChangesByIteration[Iteration]   * (MaxSearchTime / 2)
                                 + BestMoveChangesByIteration[Iteration-1] * (MaxSearchTime / 3);
 
-            // If we need some more and we are in time advantage take it
-            if (ExtraSearchTime > 0 && TimeAdvantage > 2 * MaxSearchTime)
-                ExtraSearchTime += MaxSearchTime / 2;
-
             // Try to guess if the current iteration is the last one or the last two
             LastIterations = (current_search_time() > ((MaxSearchTime + ExtraSearchTime)*58) / 128);
 
             // Try to guess if the current iteration is the last one or the last two
             LastIterations = (current_search_time() > ((MaxSearchTime + ExtraSearchTime)*58) / 128);