Skip to content

Commit

Permalink
Set contempt appropriately. Bench: 5712242.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano80 committed Feb 5, 2018
1 parent 63256e5 commit 9ed5f64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ void Thread::search() {

multiPV = std::min(multiPV, rootMoves.size());

int contempt = Options["Contempt"] * PawnValueEg / 100; // From centipawns
Eval::Contempt = (rootPos.side_to_move() == WHITE ? make_score(contempt, contempt / 2)
: -make_score(contempt, contempt / 2));

// Iterative deepening loop until requested to stop or the target depth is reached
while ( (rootDepth += ONE_PLY) < DEPTH_MAX
&& !Threads.stop
Expand Down Expand Up @@ -338,7 +342,7 @@ void Thread::search() {
beta = std::min(rootMoves[PVIdx].previousScore + delta, VALUE_INFINITE);

// Adjust contempt based on current situation
int contempt = Options["Contempt"] * PawnValueEg / 100 + bestValue/10; // From centipawns
contempt = Options["Contempt"] * PawnValueEg / 100 + bestValue/10; // From centipawns
Eval::Contempt = (rootPos.side_to_move() == WHITE ? make_score(contempt, contempt / 2)
: -make_score(contempt, contempt / 2));

Expand Down

0 comments on commit 9ed5f64

Please sign in to comment.