]> git.sesse.net Git - stockfish/commitdiff
Retire eval weights UCI options
authorMarco Costalba <mcostalba@gmail.com>
Sun, 1 Jun 2014 11:37:21 +0000 (13:37 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 1 Jun 2014 11:37:21 +0000 (13:37 +0200)
There is really little that user can achieve (apart
from a weakened engine) tweaking these parameters
that are already tuned and have no immediate or visible
effect.

So better do not expose them to the user and avoid the
typical "What is the best setup for my machine?" kind of
question (by far the most common, by far the most useless).

No functional change.

src/evaluate.cpp
src/ucioption.cpp

index 64b1bf4cf750d8d0902ce6f9d22c189eb175480b..30b107ee9565c2254f93065cc5f76438f6f0a3e8 100644 (file)
@@ -89,23 +89,15 @@ namespace {
     std::string do_trace(const Position& pos);
   }
 
-  // Evaluation weights, initialized from UCI options
+  // Evaluation weights, indexed by evaluation term
   enum { Mobility, PawnStructure, PassedPawns, Space, KingDangerUs, KingDangerThem };
-  struct Weight { int mg, eg; } Weights[6];
+  const struct Weight { int mg, eg; } Weights[] = {
+    {289, 344}, {233, 201}, {221, 273}, {46, 0}, {271, 0}, {307, 0}
+  };
 
   typedef Value V;
   #define S(mg, eg) make_score(mg, eg)
 
-  // Internal evaluation weights. These are applied on top of the evaluation
-  // weights read from UCI parameters. The purpose is to be able to change
-  // the evaluation weights while keeping the default values of the UCI
-  // parameters at 100, which looks prettier.
-  //
-  // Values modified by Joona Kiiski
-  const Score WeightsInternal[] = {
-    S(289, 344), S(233, 201), S(221, 273), S(46, 0), S(271, 0), S(307, 0)
-  };
-
   // MobilityBonus[PieceType][attacked] contains bonuses for middle and end
   // game, indexed by piece type and number of attacked squares not occupied by
   // friendly pieces.
@@ -213,17 +205,6 @@ namespace {
   }
 
 
-  // weight_option() computes the value of an evaluation weight, by combining
-  // two UCI-configurable weights (midgame and endgame) with an internal weight.
-
-  Weight weight_option(const std::string& mgOpt, const std::string& egOpt, Score internalWeight) {
-
-    Weight w = { Options[mgOpt] * mg_value(internalWeight) / 100,
-                 Options[egOpt] * eg_value(internalWeight) / 100 };
-    return w;
-  }
-
-
   // init_eval_info() initializes king bitboards for given color adding
   // pawn attacks. To be done at the beginning of the evaluation.
 
@@ -898,13 +879,6 @@ namespace Eval {
 
   void init() {
 
-    Weights[Mobility]       = weight_option("Mobility (Midgame)", "Mobility (Endgame)", WeightsInternal[Mobility]);
-    Weights[PawnStructure]  = weight_option("Pawn Structure (Midgame)", "Pawn Structure (Endgame)", WeightsInternal[PawnStructure]);
-    Weights[PassedPawns]    = weight_option("Passed Pawns (Midgame)", "Passed Pawns (Endgame)", WeightsInternal[PassedPawns]);
-    Weights[Space]          = weight_option("Space", "Space", WeightsInternal[Space]);
-    Weights[KingDangerUs]   = weight_option("Cowardice", "Cowardice", WeightsInternal[KingDangerUs]);
-    Weights[KingDangerThem] = weight_option("Aggressiveness", "Aggressiveness", WeightsInternal[KingDangerThem]);
-
     const double MaxSlope = 30;
     const double Peak = 1280;
 
index d5db2c97bd2df16b06074d67c52bc7f44a5934ca..6a4dfd6d703d79b7ba15208c833b091501ed9e6b 100644 (file)
@@ -60,15 +60,6 @@ void init(OptionsMap& o) {
   o["Book File"]                << Option("book.bin");
   o["Best Book Move"]           << Option(false);
   o["Contempt Factor"]          << Option(0, -50,  50);
-  o["Mobility (Midgame)"]       << Option(100, 0, 200, on_eval);
-  o["Mobility (Endgame)"]       << Option(100, 0, 200, on_eval);
-  o["Pawn Structure (Midgame)"] << Option(100, 0, 200, on_eval);
-  o["Pawn Structure (Endgame)"] << Option(100, 0, 200, on_eval);
-  o["Passed Pawns (Midgame)"]   << Option(100, 0, 200, on_eval);
-  o["Passed Pawns (Endgame)"]   << Option(100, 0, 200, on_eval);
-  o["Space"]                    << Option(100, 0, 200, on_eval);
-  o["Aggressiveness"]           << Option(100, 0, 200, on_eval);
-  o["Cowardice"]                << Option(100, 0, 200, on_eval);
   o["Min Split Depth"]          << Option(0, 0, 12, on_threads);
   o["Threads"]                  << Option(1, 1, MAX_THREADS, on_threads);
   o["Hash"]                     << Option(32, 1, 16384, on_hash_size);