diff --git a/source/search.cpp b/source/search.cpp index b1d35ce..6e3c9ec 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -30,8 +30,6 @@ static int ScoreMove(Board &board, Move &move) { return 50000; } - if (attackerType == -1 || targetType == -1) std::cout << "asd\n"; - if (move.IsCapture()) { return moveScoreTable[attackerType][targetType] + 10000; } else { @@ -307,6 +305,7 @@ static SearchResults ID(Board &board, SearchParams params) { std::cout << "depth " << depth; std::cout << " score cp " << safeResults.score; std::cout << " nodes " << nodes << " nps " << int(nodes/elapsed); + std::cout << " hashfull " << TT.GetUsedPercentage(); std::cout << " pv "; pvLine.Print(0); std::cout << std::endl; diff --git a/source/tt.h b/source/tt.h index 6e24179..886e696 100644 --- a/source/tt.h +++ b/source/tt.h @@ -18,12 +18,16 @@ void InitZobrist(); U64 GetHashKey(Board &board); class TTEntry { - public: +public: U64 hashKey; int depth; int score; int nodeType; Move bestMove; + + operator U64() { + return hashKey; + } }; // 5 MB @@ -51,6 +55,17 @@ public: return current; } + // returns used space per mill + int GetUsedPercentage() { + int count = 0; + + for (int i = 0; i < 1000; i++) { + if (table[i]) count++; + } + + return count; + } + SearchResults ReadEntry(U64 &hashKey, int depth, int alpha, int beta); void WriteEntry(U64 &hashKey, int depth, int score, int nodeType, Move besteMove);