mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08:00
Simplify WeakUnopposedPawn #2181
This is a functional simplification. Moves WeakUnopposedPawn to pawns.cpp and remove piece dependency. STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 8699 W: 2000 L: 1853 D: 4846 http://tests.stockfishchess.org/tests/view/5cf7721b0ebc5925cf08ee79 LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 46605 W: 7969 L: 7890 D: 30746 http://tests.stockfishchess.org/tests/view/5cf7d5f70ebc5925cf08fa96
This commit is contained in:
committed by
Marco Costalba
parent
6ed81f09ff
commit
5935daf8a5
@@ -35,6 +35,7 @@ namespace {
|
||||
constexpr Score Backward = S( 9, 24);
|
||||
constexpr Score Doubled = S(11, 56);
|
||||
constexpr Score Isolated = S( 5, 15);
|
||||
constexpr Score WeakUnopposed = S( 13, 27);
|
||||
|
||||
// Connected pawn bonus
|
||||
constexpr int Connected[RANK_NB] = { 0, 7, 8, 12, 29, 48, 86 };
|
||||
@@ -77,7 +78,7 @@ namespace {
|
||||
Bitboard ourPawns = pos.pieces( Us, PAWN);
|
||||
Bitboard theirPawns = pos.pieces(Them, PAWN);
|
||||
|
||||
e->passedPawns[Us] = e->pawnAttacksSpan[Us] = e->weakUnopposed[Us] = 0;
|
||||
e->passedPawns[Us] = e->pawnAttacksSpan[Us] = 0;
|
||||
e->kingSquares[Us] = SQ_NONE;
|
||||
e->pawnAttacks[Us] = pawn_attacks_bb<Us>(ourPawns);
|
||||
|
||||
@@ -132,10 +133,10 @@ namespace {
|
||||
score += make_score(v, v * (r - 2) / 4);
|
||||
}
|
||||
else if (!neighbours)
|
||||
score -= Isolated, e->weakUnopposed[Us] += !opposed;
|
||||
score -= Isolated + WeakUnopposed * int(!opposed);
|
||||
|
||||
else if (backward)
|
||||
score -= Backward, e->weakUnopposed[Us] += !opposed;
|
||||
score -= Backward + WeakUnopposed * int(!opposed);
|
||||
|
||||
if (doubled && !support)
|
||||
score -= Doubled;
|
||||
|
||||
Reference in New Issue
Block a user