X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=13475ad4c343e23f40bc546c72bbfd991eef8545;hb=25b4d0c127af9fe564f7a797460bed4c2837bcc2;hp=d5bf662aac8e6ccd6217a13f86f8aa2139cc8b2c;hpb=31a0d2200c7e8b1db653ba0c033783787259f1e6;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d5bf662a..13475ad4 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -44,20 +44,20 @@ namespace { // all squares attacked by the given color. Bitboard attackedBy[2][8]; - // kingZone[color] is the zone around the enemy king which is considered + // kingRing[color] is the zone around the king which is considered // by the king safety evaluation. This consists of the squares directly // adjacent to the king, and the three (or two, for a king on an edge file) // squares two ranks in front of the king. For instance, if black's king - // is on g8, kingZone[WHITE] is a bitboard containing the squares f8, h8, + // is on g8, kingRing[BLACK] is a bitboard containing the squares f8, h8, // f7, g7, h7, f6, g6 and h6. - Bitboard kingZone[2]; + Bitboard kingRing[2]; // kingAttackersCount[color] is the number of pieces of the given color - // which attack a square in the kingZone of the enemy king. + // which attack a square in the kingRing of the enemy king. int kingAttackersCount[2]; // kingAttackersWeight[color] is the sum of the "weight" of the pieces of the - // given color which attack a square in the kingZone of the enemy king. The + // given color which attack a square in the kingRing of the enemy king. The // weights of the individual piece types are given by the variables // QueenAttackWeight, RookAttackWeight, BishopAttackWeight and // KnightAttackWeight in evaluate.cpp @@ -88,7 +88,7 @@ namespace { // // Values modified by Joona Kiiski const Score WeightsInternal[] = { - S(284, 229), S(252, 259), S(46, 0), S(209, 0), S(349, 0) + S(248, 271), S(252, 259), S(46, 0), S(247, 0), S(259, 0) }; // MobilityBonus[PieceType][attacked] contains mobility bonuses for middle and @@ -275,7 +275,6 @@ Value do_evaluate(const Position& pos, Value& margin) { Value margins[2]; Score score, mobilityWhite, mobilityBlack; - assert(pos.is_ok()); assert(pos.thread() >= 0 && pos.thread() < MAX_THREADS); assert(!pos.in_check()); @@ -437,12 +436,12 @@ namespace { if ( pos.piece_count(Us, QUEEN) && pos.non_pawn_material(Us) >= QueenValueMidgame + RookValueMidgame) { - ei.kingZone[Us] = (b | (Us == WHITE ? b >> 8 : b << 8)); + ei.kingRing[Them] = (b | (Us == WHITE ? b >> 8 : b << 8)); b &= ei.attackedBy[Us][PAWN]; ei.kingAttackersCount[Us] = b ? count_1s(b) / 2 : 0; ei.kingAdjacentZoneAttacksCount[Us] = ei.kingAttackersWeight[Us] = 0; } else - ei.kingZone[Us] = ei.kingAttackersCount[Us] = 0; + ei.kingRing[Them] = ei.kingAttackersCount[Us] = 0; } @@ -506,7 +505,7 @@ namespace { ei.attackedBy[Us][Piece] |= b; // King attacks - if (b & ei.kingZone[Us]) + if (b & ei.kingRing[Them]) { ei.kingAttackersCount[Us]++; ei.kingAttackersWeight[Us] += KingAttackWeights[Piece];