From: Tord Romstad Date: Tue, 30 Mar 2010 13:15:01 +0000 (+0200) Subject: Remove several unnecessary UCI options: All king safety options X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a5a8830e97cbf8005d559029d273bdb13a341278 Remove several unnecessary UCI options: All king safety options except "Aggressiveness" and "Cowardice", and "UCI_ShowCurrLine". No functional change compared to the previous version with the default settings. --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 6c4e927a..3680dd36 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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++) diff --git a/src/search.cpp b/src/search.cpp index 882fee6f..7b4ba286 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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? diff --git a/src/ucioption.cpp b/src/ucioption.cpp index d9ce20df..af568a37 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -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);