Restore deterministic search state

Introduce helper function Search::reset() which clears all kind of search
memory, in order to restore a deterministic search state.

Generalize TT.clear() into Search::reset() for the following use cases:
- bench: needed to guarantee deterministic bench (ie. if you call bench from
interactive command line twice in a row you get the same value).
- Clear Hash: restore clean search state, which is the purpose of this button.
- ucinewgame: ditto.

No functional change.

Resolves #346
This commit is contained in:
lucasart
2015-05-06 19:24:00 +08:00
committed by Gary Linscott
parent 946fa47625
commit 2e86d1febc
6 changed files with 19 additions and 4 deletions

View File

@@ -27,7 +27,6 @@
#include "search.h"
#include "thread.h"
#include "timeman.h"
#include "tt.h"
#include "uci.h"
using namespace std;
@@ -181,7 +180,7 @@ void UCI::loop(int argc, char* argv[]) {
else if (token == "ucinewgame")
{
TT.clear();
Search::reset();
Time.availableNodes = 0;
}
else if (token == "isready") sync_cout << "readyok" << sync_endl;