]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Use per-thread dynamic contempt
[stockfish] / src / search.cpp
index af0946ea577722b5f3aaab25fb5f176bae8dc094..66c406936eed57af83547d84aad79784978fa2bf 100644 (file)
@@ -309,8 +309,8 @@ void Thread::search() {
   multiPV = std::min(multiPV, rootMoves.size());
 
   int ct = Options["Contempt"] * PawnValueEg / 100; // From centipawns
-  Eval::Contempt = (us == WHITE ?  make_score(ct, ct / 2)
-                                : -make_score(ct, ct / 2));
+  contempt = (us == WHITE ?  make_score(ct, ct / 2)
+                          : -make_score(ct, ct / 2));
 
   // Iterative deepening loop until requested to stop or the target depth is reached
   while (   (rootDepth += ONE_PLY) < DEPTH_MAX
@@ -353,8 +353,8 @@ void Thread::search() {
               // Adjust contempt based on root move's previousScore (dynamic contempt)
               ct += int(std::round(48 * atan(float(previousScore) / 128)));
 
-              Eval::Contempt = (us == WHITE ?  make_score(ct, ct / 2)
-                                            : -make_score(ct, ct / 2));
+              contempt = (us == WHITE ?  make_score(ct, ct / 2)
+                                      : -make_score(ct, ct / 2));
           }
 
           // Start with a small aspiration window and, in the case of a fail