Fix Contempt Factor implementation

First disable Contempt Factor during analysis, then
calculate the modified draw score from the point of
view of the player, so from the point of view of
RootPosition color.

Thanks to Ryan Taker for suggesting the fixes.

No functional change.
This commit is contained in:
Marco Costalba
2012-10-06 10:12:34 +02:00
parent ff9ca3e76e
commit cedbd3332a
3 changed files with 12 additions and 5 deletions

View File

@@ -268,7 +268,8 @@ namespace {
namespace Eval {
Color RootColor;
Value ValueDrawContempt;
Value ContemptFactor;
Value ValueDraw[2];
/// evaluate() is the main evaluation function. It always computes two
/// values, an endgame score and a middle game score, and interpolates
@@ -309,7 +310,10 @@ namespace Eval {
KingDangerTable[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);
}
ValueDrawContempt = VALUE_DRAW - Options["Contempt Factor"] * PawnValueMg / 100;
if (Options["UCI_AnalyseMode"])
ContemptFactor = VALUE_ZERO;
else
ContemptFactor = Options["Contempt Factor"] * PawnValueMg / 100;
}