From b8326edea3081e9e00bce7bb0929005f4be45cbf Mon Sep 17 00:00:00 2001 From: Tord Romstad Date: Fri, 17 Jul 2009 22:26:01 +0200 Subject: [PATCH] Introduced the UCI_AnalyseMode option, and made the evaluation function symmetrical in analyse mode. No functional change when playing games. --- src/Makefile | 4 ++-- src/evaluate.cpp | 8 ++++++++ src/ucioption.cpp | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 5e27f9e7..09e79563 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,7 +44,7 @@ clean: ### Compiler: ### -CXX = g++ +CXX = g++-4.2 # CXX = icpc @@ -67,7 +67,7 @@ include .depend # Enable/disable debugging, disabled by default -CXXFLAGS += -DNDEBUG +# CXXFLAGS += -DNDEBUG # Compile with full warnings, and symbol names stripped, you can use diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 486bb810..7a4176b7 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -532,6 +532,14 @@ void read_weights(Color us) { WeightKingSafety[us] = weight_option("Cowardice", WeightKingSafetyInternal); WeightKingSafety[them] = weight_option("Aggressiveness", WeightKingOppSafetyInternal); + // If running in analysis mode, make sure we use symmetrical king safety. + // We do this by replacing both WeightKingSafety[us] and + // WeightKingSafety[them] by their average. + if (get_option_value_bool("UCI_AnalyseMode")) { + WeightKingSafety[us] = (WeightKingSafety[us] + WeightKingSafety[them]) / 2; + WeightKingSafety[them] = WeightKingSafety[us]; + } + WeightSpace = weight_option("Space", WeightSpaceInternal); init_safety(); diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 92729355..a0269464 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -130,6 +130,7 @@ namespace { o["MultiPV"] = Option(1, 1, 500); o["UCI_ShowCurrLine"] = Option(false); o["UCI_Chess960"] = Option(false); + o["UCI_AnalyseMode"] = Option(false); // Any option should know its name so to be easily printed for (Options::iterator it = o.begin(); it != o.end(); ++it) -- 2.39.2