1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Further improve chain pawn evaluation

Passed both short TC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 28299 W: 5854 L: 5667 D: 16778

And long TC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 9738 W: 1797 L: 1644 D: 6297

bench: 9294116
This commit is contained in:
Ralph Stößer 2013-10-20 23:41:02 +02:00 committed by Marco Costalba
parent f22a63ce67
commit 97015afce8

View file

@ -52,10 +52,16 @@ namespace {
S(33, 31), S(33, 31), S(29, 31), S(20, 28) }};
// Pawn chain membership bonus by file
const Score ChainMember[FILE_NB] = {
S(11,-1), S(13,-1), S(13,-1), S(14,-1),
S(14,-1), S(13,-1), S(13,-1), S(11,-1)
};
const Score ChainMember[FILE_NB][RANK_NB] = {
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) },
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) }
};
// Candidate passed pawn bonus by rank
const Score CandidatePassed[RANK_NB] = {
@ -92,6 +98,7 @@ namespace {
Bitboard b;
Square s;
File f;
Rank r;
bool passed, isolated, doubled, opposed, chain, backward, candidate;
Score value = SCORE_ZERO;
const Square* pl = pos.list<PAWN>(Us);
@ -112,6 +119,7 @@ namespace {
assert(pos.piece_on(s) == make_piece(Us, PAWN));
f = file_of(s);
r = relative_rank(Us, s);
// This file cannot be semi-open
e->semiopenFiles[Us] &= ~(1 << f);
@ -176,11 +184,11 @@ namespace {
value -= Backward[opposed][f];
if (chain)
value += ChainMember[f] + CandidatePassed[relative_rank(Us, s)] / 2;
value += opposed ? ChainMember[f][r] / 2 : ChainMember[f][r];
if (candidate)
{
value += CandidatePassed[relative_rank(Us, s)];
value += CandidatePassed[r];
if (!doubled)
e->candidatePawns[Us] |= s;