Skip to content

Commit

Permalink
penalty for more material if losing. bench 3568335
Browse files Browse the repository at this point in the history
  • Loading branch information
xoto10 committed Nov 8, 2018
1 parent 5cd9f6c commit 879f285
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,13 @@ namespace {
Trace::add(TOTAL, score);
}

return (pos.side_to_move() == WHITE ? v : -v) // Side to move point of view
+ Eval::Tempo;
v = (pos.side_to_move() == WHITE ? v : -v) // Side to move point of view
+ Eval::Tempo;
// Penalty for more material on board if losing
if (v < 0)
v -= pos.non_pawn_material(pos.side_to_move()) / 512;

return v;
}

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void Thread::search() {
beta = std::min(previousScore + delta, VALUE_INFINITE);

// Adjust contempt based on root move's previousScore (dynamic contempt)
int dct = ct + 88 * previousScore / (abs(previousScore) + (previousScore<0 ? 100 : 200));
int dct = ct + 88 * previousScore / (abs(previousScore) + 200);

contempt = (us == WHITE ? make_score(dct, dct / 2)
: -make_score(dct, dct / 2));
Expand Down

0 comments on commit 879f285

Please sign in to comment.