]> git.sesse.net Git - stockfish/commitdiff
Temporarily removed the unfinished UCI_Elo code in preparation for
authorTord Romstad <tord@glaurungchess.com>
Tue, 29 Sep 2009 11:40:00 +0000 (13:40 +0200)
committerTord Romstad <tord@glaurungchess.com>
Tue, 29 Sep 2009 11:40:00 +0000 (13:40 +0200)
the release of the public Stockfish 1.5.

src/search.cpp
src/ucioption.cpp

index 7d8f8e87e2e9b54f879399182ccccdb839396c88..4ba85b4861d38839e80ba78cc2f1d1e76275296c 100644 (file)
@@ -193,16 +193,6 @@ namespace {
 
   /// Variables initialized by UCI options
 
 
   /// Variables initialized by UCI options
 
-  // Adjustable playing strength
-  int Slowdown = 0;
-  const int SlowdownArray[32] = {
-    19, 41, 70, 110, 160, 230, 320, 430, 570, 756, 1000, 1300, 1690, 2197,
-    2834, 3600, 4573, 5809, 7700, 9863, 12633, 16181, 20726, 26584, 34005,
-    43557, 55792, 71463, 91536, 117247, 150180, 192363
-  };
-  int Strength;
-  const int MaxStrength = 25;
-
   // Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes
   int LMRPVMoves, LMRNonPVMoves; // heavy SMP read access for the latter
 
   // Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes
   int LMRPVMoves, LMRNonPVMoves; // heavy SMP read access for the latter
 
@@ -302,7 +292,6 @@ namespace {
   bool ok_to_history(const Position& pos, Move m);
   void update_history(const Position& pos, Move m, Depth depth, Move movesSearched[], int moveCount);
   void update_killers(Move m, SearchStack& ss);
   bool ok_to_history(const Position& pos, Move m);
   void update_history(const Position& pos, Move m, Depth depth, Move movesSearched[], int moveCount);
   void update_killers(Move m, SearchStack& ss);
-  void slowdown(const Position& pos);
 
   bool fail_high_ply_1();
   int current_search_time();
 
   bool fail_high_ply_1();
   int current_search_time();
@@ -423,10 +412,8 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
 
   read_weights(pos.side_to_move());
 
 
   read_weights(pos.side_to_move());
 
-  // Set the number of active threads. If UCI_LimitStrength is enabled, never
-  // use more than one thread.
-  int newActiveThreads =
-    get_option_value_bool("UCI_LimitStrength")? 1 : get_option_value_int("Threads");
+  // Set the number of active threads.
+  int newActiveThreads = get_option_value_int("Threads");
   if (newActiveThreads != ActiveThreads)
   {
       ActiveThreads = newActiveThreads;
   if (newActiveThreads != ActiveThreads)
   {
       ActiveThreads = newActiveThreads;
@@ -439,19 +426,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   for (int i = 1; i < ActiveThreads; i++)
       assert(thread_is_available(i, 0));
 
   for (int i = 1; i < ActiveThreads; i++)
       assert(thread_is_available(i, 0));
 
-  // Set playing strength
-  if (get_option_value_bool("UCI_LimitStrength"))
-  {
-      Strength = (get_option_value_int("UCI_Elo") - 2100) / 25;
-      Slowdown =
-        (Strength == MaxStrength)? 0 : SlowdownArray[Max(0, 31-Strength)];
-  }
-  else
-  {
-      Strength = MaxStrength;
-      Slowdown = 0;
-  }
-
   // Set thinking time
   int myTime = time[side_to_move];
   int myIncrement = increment[side_to_move];
   // Set thinking time
   int myTime = time[side_to_move];
   int myIncrement = increment[side_to_move];
@@ -496,13 +470,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
       NodesBetweenPolls = Min(MaxNodes, 30000);
       InfiniteSearch = true; // HACK
   }
       NodesBetweenPolls = Min(MaxNodes, 30000);
       InfiniteSearch = true; // HACK
   }
-  else if (Slowdown) {
-      if (Slowdown > 50000) NodesBetweenPolls = 30;
-      else if (Slowdown > 10000) NodesBetweenPolls = 100;
-      else if (Slowdown > 1000) NodesBetweenPolls = 500;
-      else if (Slowdown > 100) NodesBetweenPolls = 3000;
-      else NodesBetweenPolls = 15000;
-  }
   else
       NodesBetweenPolls = 30000;
 
   else
       NodesBetweenPolls = 30000;
 
@@ -2107,9 +2074,6 @@ namespace {
     assert(ply >= 0 && ply < PLY_MAX);
     assert(threadID >= 0 && threadID < ActiveThreads);
 
     assert(ply >= 0 && ply < PLY_MAX);
     assert(threadID >= 0 && threadID < ActiveThreads);
 
-    if (Slowdown && Iteration >= 3)
-      slowdown(pos);
-
     Threads[threadID].nodes++;
 
     if (threadID == 0)
     Threads[threadID].nodes++;
 
     if (threadID == 0)
@@ -2447,21 +2411,6 @@ namespace {
   }
 
 
   }
 
 
-  // slowdown() simply wastes CPU cycles doing nothing useful. It's used
-  // in strength handicap mode.
-
-  void slowdown(const Position &pos) {
-    int i, n;
-    n = Slowdown;
-    for (i = 0; i < n; i++)  {
-        Square s = Square(i&63);
-        if (count_1s(pos.attackers_to(s)) > 63)
-            std::cout << "This can't happen, but I put this string here anyway, in order to "
-                         "prevent the compiler from optimizing away the useless computation." << std::endl;
-    }
-  }
-
-
   // fail_high_ply_1() checks if some thread is currently resolving a fail
   // high at ply 1 at the node below the first root node.  This information
   // is used for time managment.
   // fail_high_ply_1() checks if some thread is currently resolving a fail
   // high at ply 1 at the node below the first root node.  This information
   // is used for time managment.
index c1b351379df98f2e4a5316e0d262c933d4df72db..1b8665546a20297d1047c564db736cec0f7800ea 100644 (file)
@@ -131,8 +131,6 @@ namespace {
     o["UCI_ShowCurrLine"] = Option(false);
     o["UCI_Chess960"] = Option(false);
     o["UCI_AnalyseMode"] = Option(false);
     o["UCI_ShowCurrLine"] = Option(false);
     o["UCI_Chess960"] = Option(false);
     o["UCI_AnalyseMode"] = Option(false);
-    o["UCI_LimitStrength"] = Option(false);
-    o["UCI_Elo"] = Option(2900, 2100, 2900);
 
     // Any option should know its name so to be easily printed
     for (Options::iterator it = o.begin(); it != o.end(); ++it)
 
     // Any option should know its name so to be easily printed
     for (Options::iterator it = o.begin(); it != o.end(); ++it)