Skip to content

Commit 83e19fb

Browse files
locutus2zamar
authored andcommitted
File based passed pawn bonus
Add file based bonus for passed pawns. Values tuned by SPSA. STC: LLR: 3.33 (-2.94,2.94) [0.00,5.00] Total: 36889 W: 6805 L: 6507 D: 23577 LTC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 32301 W: 5101 L: 4858 D: 22342 Bench: 8073614 Resolves #436
1 parent 9f5b31c commit 83e19fb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/evaluate.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ namespace {
170170
{ V(7), V(14), V(37), V(63), V(134), V(189) }
171171
};
172172

173+
// PassedFile[File] contains a bonus according to the file of a passed pawn.
174+
const Score PassedFile[] = {
175+
S( 14, 13), S( 2, 5), S(-3, -4), S(-19, -14),
176+
S(-19, -14), S(-3, -4), S( 2, 5), S( 14, 13)
177+
};
178+
173179
const Score ThreatenedByHangingPawn = S(40, 60);
174180

175181
// Assorted bonuses and penalties used by evaluation
@@ -652,7 +658,7 @@ namespace {
652658
if (pos.count<PAWN>(Us) < pos.count<PAWN>(Them))
653659
ebonus += ebonus / 4;
654660

655-
score += make_score(mbonus, ebonus);
661+
score += make_score(mbonus, ebonus) + PassedFile[file_of(s)];
656662
}
657663

658664
if (DoTrace)

0 commit comments

Comments
 (0)