]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Restore deterministic search state
[stockfish] / src / search.cpp
index 9c7190bed0cacb99e7d813df7196e205cb23bac8..152e9fd68c4812854d0ce3d098581586fb56102f 100644 (file)
@@ -181,6 +181,18 @@ void Search::init() {
 }
 
 
+/// Search::reset() clears all search memory, to restore a deterministic state
+
+void Search::reset () {
+
+    TT.clear();
+    History.clear();
+    CounterMovesHistory.clear();
+    Gains.clear();
+    Countermoves.clear();
+}
+
+
 /// Search::perft() is our utility to verify move generation. All the leaf nodes
 /// up to the given depth are generated and counted and the sum returned.
 template<bool Root>