]> git.sesse.net Git - stockfish/commitdiff
Remove several unnecessary UCI options: All king safety options
authorTord Romstad <tord@cm-84.215.83.169.getinternet.no>
Tue, 30 Mar 2010 13:15:01 +0000 (15:15 +0200)
committerTord Romstad <tord@cm-84.215.83.169.getinternet.no>
Tue, 30 Mar 2010 13:15:01 +0000 (15:15 +0200)
except "Aggressiveness" and "Cowardice", and "UCI_ShowCurrLine".
No functional change compared to the previous version with the
default settings.

src/evaluate.cpp
src/search.cpp
src/ucioption.cpp

index 6c4e927ac804b4fa5296f7ecf06e529c0f81bea9..3680dd36fc30131867bfac8f588bd0ce30731636 100644 (file)
@@ -224,15 +224,19 @@ namespace {
 
   const int AttackWeight[] = { 0, 0, KnightAttackWeight, BishopAttackWeight, RookAttackWeight, QueenAttackWeight };
 
-  // Bonuses for safe checks, initialized from UCI options
-  int QueenContactCheckBonus, DiscoveredCheckBonus;
-  int QueenCheckBonus, RookCheckBonus, BishopCheckBonus, KnightCheckBonus;
+  // Bonuses for safe checks
+  const int QueenContactCheckBonus = 3;
+  const int DiscoveredCheckBonus   = 3;
+  const int QueenCheckBonus        = 2; 
+  const int RookCheckBonus         = 1;
+  const int BishopCheckBonus       = 1; 
+  const int KnightCheckBonus       = 1;
 
   // Scan for queen contact mates?
   const bool QueenContactMates = true;
 
-  // Bonus for having a mate threat, initialized from UCI options
-  int MateThreatBonus;
+  // Bonus for having a mate threat
+  const int MateThreatBonus = 3;
 
   // InitKingDanger[] contains bonuses based on the position of the defending
   // king.
@@ -1200,29 +1204,17 @@ namespace {
 
   void init_safety() {
 
-    QueenContactCheckBonus = get_option_value_int("Queen Contact Check Bonus");
-    QueenCheckBonus        = get_option_value_int("Queen Check Bonus");
-    RookCheckBonus         = get_option_value_int("Rook Check Bonus");
-    BishopCheckBonus       = get_option_value_int("Bishop Check Bonus");
-    KnightCheckBonus       = get_option_value_int("Knight Check Bonus");
-    DiscoveredCheckBonus   = get_option_value_int("Discovered Check Bonus");
-    MateThreatBonus        = get_option_value_int("Mate Threat Bonus");
-
-    int maxSlope = get_option_value_int("King Safety Max Slope");
-    int peak     = get_option_value_int("King Safety Max Value") * 256 / 100;
-    double a     = get_option_value_int("King Safety Coefficient") / 100.0;
-    double b     = get_option_value_int("King Safety X Intercept");
-    bool quad    = (get_option_value_string("King Safety Curve") == "Quadratic");
-    bool linear  = (get_option_value_string("King Safety Curve") == "Linear");
+    int maxSlope = 30;
+    int peak     = 0x500;
+    double a     = 0.4;
+    double b     = 0.0;
 
     for (int i = 0; i < 100; i++)
     {
         if (i < b)
             SafetyTable[i] = Value(0);
-        else if (quad)
+        else
             SafetyTable[i] = Value((int)(a * (i - b) * (i - b)));
-        else if (linear)
-            SafetyTable[i] = Value((int)(100 * a * (i - b)));
     }
 
     for (int i = 0; i < 100; i++)
index 882fee6f0ee8ec5940c54b2601f085581dd88918..7b4ba28618c537eb5804a67107008a150bb4d3a0 100644 (file)
@@ -259,9 +259,6 @@ namespace {
   bool UseTimeManagement, InfiniteSearch, PonderSearch, StopOnPonderhit;
   bool FirstRootMove, AbortSearch, Quit, AspirationFailLow;
 
-  // Show current line?
-  bool ShowCurrentLine;
-
   // Log file
   bool UseLogFile;
   std::ofstream LogFile;
@@ -425,7 +422,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
 
   MinimumSplitDepth       = get_option_value_int("Minimum Split Depth") * OnePly;
   MaxThreadsPerSplitPoint = get_option_value_int("Maximum Number of Threads per Split Point");
-  ShowCurrentLine         = get_option_value_bool("UCI_ShowCurrLine");
   MultiPV                 = get_option_value_int("MultiPV");
   Chess960                = get_option_value_bool("UCI_Chess960");
   UseLogFile              = get_option_value_bool("Use Search Log");
@@ -2464,16 +2460,6 @@ namespace {
 
         cout << "info nodes " << TM.nodes_searched() << " nps " << nps()
              << " time " << t << " hashfull " << TT.full() << endl;
-
-        // We only support current line printing in single thread mode
-        if (ShowCurrentLine && TM.active_threads() == 1)
-        {
-            cout << "info currline";
-            for (int p = 0; p < ply; p++)
-                cout << " " << ss[p].currentMove;
-
-            cout << endl;
-        }
     }
 
     // Should we stop the search?
index d9ce20df58e0771efbe5ac6d716bd04697ab3f2d..af568a37953799786ce4f15aec954cc18b817e2a 100644 (file)
@@ -88,22 +88,6 @@ namespace {
     o["Space"] = Option(100, 0, 200);
     o["Aggressiveness"] = Option(100, 0, 200);
     o["Cowardice"] = Option(100, 0, 200);
-    o["King Safety Curve"] = Option("Quadratic", COMBO);
-
-       o["King Safety Curve"].comboValues.push_back("Quadratic");
-       o["King Safety Curve"].comboValues.push_back("Linear");  /*, "From File"*/
-
-    o["King Safety Coefficient"] = Option(40, 1, 100);
-    o["King Safety X Intercept"] = Option(0, 0, 20);
-    o["King Safety Max Slope"] = Option(30, 10, 100);
-    o["King Safety Max Value"] = Option(500, 100, 1000);
-    o["Queen Contact Check Bonus"] = Option(3, 0, 8);
-    o["Queen Check Bonus"] = Option(2, 0, 4);
-    o["Rook Check Bonus"] = Option(1, 0, 4);
-    o["Bishop Check Bonus"] = Option(1, 0, 4);
-    o["Knight Check Bonus"] = Option(1, 0, 4);
-    o["Discovered Check Bonus"] = Option(3, 0, 8);
-    o["Mate Threat Bonus"] = Option(3, 0, 8);
     o["Check Extension (PV nodes)"] = Option(2, 0, 2);
     o["Check Extension (non-PV nodes)"] = Option(1, 0, 2);
     o["Single Evasion Extension (PV nodes)"] = Option(2, 0, 2);
@@ -126,7 +110,6 @@ namespace {
     o["Ponder"] = Option(true);
     o["OwnBook"] = Option(true);
     o["MultiPV"] = Option(1, 1, 500);
-    o["UCI_ShowCurrLine"] = Option(false);
     o["UCI_Chess960"] = Option(false);
     o["UCI_AnalyseMode"] = Option(false);