]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Introduce simple_eval() for lazy evaluations
[stockfish] / src / thread.cpp
index 202768c863cc9e1f6ca7d0f38de44fb9f1674a43..60f760ed46ee48bf70b0157773d668b6a5793cfa 100644 (file)
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <cassert>
+#include "thread.h"
 
-#include <algorithm> // For std::count
+#include <algorithm>
+#include <cassert>
+#include <cstdlib>
+#include <deque>
+#include <initializer_list>
+#include <map>
+#include <memory>
+#include <utility>
+
+#include "evaluate.h"
+#include "misc.h"
 #include "movegen.h"
 #include "search.h"
-#include "thread.h"
-#include "uci.h"
 #include "syzygy/tbprobe.h"
 #include "tt.h"
+#include "uci.h"
 
 namespace Stockfish {
 
@@ -160,7 +169,6 @@ void ThreadPool::clear() {
   main()->bestPreviousScore = VALUE_INFINITE;
   main()->bestPreviousAverageScore = VALUE_INFINITE;
   main()->previousTimeReduction = 1.0;
-  main()->complexity = 1.0;
 }
 
 
@@ -205,6 +213,7 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
       th->rootMoves = rootMoves;
       th->rootPos.set(pos.fen(), pos.is_chess960(), &th->rootState, th);
       th->rootState = setupStates->back();
+      th->rootSimpleEval = Eval::simple_eval(pos, pos.side_to_move());
   }
 
   main()->start_searching();