From 5a42427cb882f8adcfe65d41f4fabac5d2ac4a5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Nicolet?= Date: Thu, 26 Nov 2015 10:15:51 +0100 Subject: [PATCH] Introduce new Threats weights = {350, 256} Raise the midgame threats weight by 37%. Passed STC: LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 8165 W: 1675 L: 1487 D: 5003 and LTC: LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 28181 W: 4141 L: 3912 D: 20128 Bench: 7824961 Resolves #512 --- src/evaluate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 2e1465ff..406d0745 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -107,10 +107,10 @@ namespace { // Evaluation weights, indexed by the corresponding evaluation term - enum { Mobility, PawnStructure, PassedPawns, Space, KingSafety }; + enum { Mobility, PawnStructure, PassedPawns, Space, KingSafety, Threats }; const struct Weight { int mg, eg; } Weights[] = { - {289, 344}, {233, 201}, {221, 273}, {46, 0}, {322, 0} + {289, 344}, {233, 201}, {221, 273}, {46, 0}, {322, 0}, {350, 256} }; Score operator*(Score s, const Weight& w) { @@ -566,9 +566,9 @@ namespace { score += popcount(b) * PawnAttackThreat; if (DoTrace) - Trace::add(THREAT, Us, score); + Trace::add(THREAT, Us, score * Weights[Threats]); - return score; + return score * Weights[Threats]; } -- 2.39.2