multiPV = std::min(multiPV, rootMoves.size());
int ct = Options["Contempt"] * PawnValueEg / 100; // From centipawns
+
+ // In analysis mode, adjust contempt in accordance with user preference
+ if (Limits.infinite || Options["UCI_AnalyseMode"])
+ ct = Options["Analysis Contempt"] == "Off" ? 0
+ : Options["Analysis Contempt"] == "Both" ? ct
+ : Options["Analysis Contempt"] == "White" && us == BLACK ? -ct
+ : Options["Analysis Contempt"] == "Black" && us == WHITE ? -ct
+ : ct;
+
+ // In evaluate.cpp the evaluation is from the white point of view
contempt = (us == WHITE ? make_score(ct, ct / 2)
: -make_score(ct, ct / 2));
alpha = std::max(previousScore - delta,-VALUE_INFINITE);
beta = std::min(previousScore + delta, VALUE_INFINITE);
- ct = Options["Contempt"] * PawnValueEg / 100; // From centipawns
-
// Adjust contempt based on root move's previousScore (dynamic contempt)
- ct += int(std::round(48 * atan(float(previousScore) / 128)));
+ int dct = ct + int(std::round(48 * atan(float(previousScore) / 128)));
- contempt = (us == WHITE ? make_score(ct, ct / 2)
- : -make_score(ct, ct / 2));
+ contempt = (us == WHITE ? make_score(dct, dct / 2)
+ : -make_score(dct, dct / 2));
}
// Start with a small aspiration window and, in the case of a fail