Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/eval_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inline const PParam BISHOP_PAIR_VAL = S(64, 230);
inline const PParam ROOK_OPEN_VAL = S(109, -2);
inline const PParam ROOK_SEMIOPEN_VAL = S(43, 13);
inline const PParam MINOR_BEHIND_PAWN = S(15, 39);
inline const PParam RESTRICTED_SQUARES = S(-20, -4);
inline const PParam RESTRICTED_SQUARES = S(20, 4);

inline const PParam DOUBLED_PAWN_VAL = S(-20, -82);
inline const PParam ISOLATED_PAWN_VAL = S(-14, -36);
Expand Down
9 changes: 3 additions & 6 deletions src/evaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ PScore evaluate_threats(const Position& pos, const EvalData& data) {
eval += HANGING_NON_PAWN * (b & opp_non_pawn).ipopcount();
}

eval += RESTRICTED_SQUARES
* (data.attacked_by(color) & ~strongly_protected & data.attacked_by(opp)).ipopcount();

Bitboard pawn_attacks = data.attacked_by(color, PieceType::Pawn);
eval +=
PAWN_THREAT_KNIGHT * (pos.bitboard_for(opp, PieceType::Knight) & pawn_attacks).ipopcount();
Expand Down Expand Up @@ -595,12 +598,6 @@ PScore evaluate_space(const Position& pos, const EvalData& data) {
& (pos.bitboard_for(them, PieceType::Pawn) | pos.bitboard_for(color, PieceType::Pawn)))
.ipopcount();

Bitboard strongly_defended = data.attacked_by(color, PieceType::Pawn)
| (data.attacked_by_2(color) & ~data.attacked_by_2(them));

eval += RESTRICTED_SQUARES
* (data.attacked_by(color) & ~strongly_defended & data.attacked_by(them)).ipopcount();

return eval;
}

Expand Down
Loading