public void SetBestMove(ChessBoard cb, int bestMove, int alpha, int beta, int bestScore, int depth) { if (_threadNumber != 0) { return; } BestScore = bestScore; Depth = depth; if (bestScore <= alpha) { ScoreType = ScoreType.Upper; } else if (bestScore >= beta) { ScoreType = ScoreType.Lower; } else { ScoreType = ScoreType.Exact; } PvUtil.Set(cb, Pv, bestMove); }
public static void SendPlyInfo(ThreadData threadData) { if (NoOutput) { return; } Stopwatch.Restart(); var totalMoveCount = ChessBoardUtil.CalculateTotalMoveCount(); // info depth 1 seldepth 2 score cp 50 pv d2d4 d7d5 e2e3 hashfull 0 nps 1000 nodes 22 // info depth 4 seldepth 10 score cp 40 upperbound pv d2d4 d7d5 e2e3 hashfull 0 nps 30000 nodes 1422 Console.WriteLine("info depth " + threadData.Depth + " time " + TimeUtil.GetPassedTimeMs() + " score cp " + threadData.BestScore + threadData.ScoreType.ToFriendlyName() + "nps " + CalculateNps(totalMoveCount) + " nodes " + totalMoveCount + " hashfull " + TtUtil.GetUsagePercentage() + " pv " + PvUtil.AsString(threadData.Pv)); }