X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=7a4176b78af7834a92eb2a90d0b5d2f2b1e42637;hp=486bb810cb995b6f0a356f95f85ca2a0a09a1abd;hb=b8326edea3081e9e00bce7bb0929005f4be45cbf;hpb=20e87389019187dd7586d3ffb12b632d5ec5d048 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();