X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=5e4f4bdd6dc71749b22aba8417a7b5d2ed098664;hp=d533eed8c76d17172c10632c2c0cdada03a5a7a6;hb=4c95edddbf1aaec22c343adaca4796df0137e4c3;hpb=5cffc032da8402df79cf6cba4238b83ff5d29f7e diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d533eed8..5e4f4bdd 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -706,9 +706,9 @@ namespace { // ...count safe + (behind & safe) with a single popcount int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe)); bonus = std::min(16, bonus); - int weight = pos.count(Us); + int weight = pos.count(Us) - 2 * ei.pi->open_files(); - return make_score(bonus * weight * weight / 22, 0); + return make_score(bonus * weight * weight / 18, 0); } @@ -779,23 +779,22 @@ Value Eval::evaluate(const Position& pos) { assert(!pos.checkers()); + Score mobility[COLOR_NB] = { SCORE_ZERO, SCORE_ZERO }; EvalInfo ei; - Score score, mobility[COLOR_NB] = { SCORE_ZERO, SCORE_ZERO }; - - // Initialize score by reading the incrementally updated scores included in - // the position object (material + piece square tables). Score is computed - // internally from the white point of view. - score = pos.psq_score(); // Probe the material hash table ei.me = Material::probe(pos); - score += ei.me->imbalance(); // If we have a specialized evaluation function for the current material // configuration, call it and return. if (ei.me->specialized_eval_exists()) return ei.me->evaluate(pos); + // Initialize score by reading the incrementally updated scores included in + // the position object (material + piece square tables) and the material + // imbalance. Score is computed internally from the white point of view. + Score score = pos.psq_score() + ei.me->imbalance(); + // Probe the pawn hash table ei.pi = Pawns::probe(pos); score += ei.pi->pawns_score();