Skip to content
Permalink
Browse files

Revert "Introduce voting system for best move selection"

This reverts commit d96c1c3.
  • Loading branch information...
CoffeeOne committed Mar 25, 2019
1 parent 67633de commit cd6014f88496489181ad1e479e904e4f75d0a716
Showing with 7 additions and 17 deletions.
  1. +7 −17 src/search.cpp
@@ -231,26 +231,16 @@ void MainThread::search() {
&& !Skill(Options["Skill Level"]).enabled()
&& rootMoves[0].pv[0] != MOVE_NONE)
{
std::map<Move, int> votes;
Value minScore = this->rootMoves[0].score;

// Find out minimum score and reset votes for moves which can be voted
for (Thread* th: Threads)
minScore = std::min(minScore, th->rootMoves[0].score);

// Vote according to score and depth
for (Thread* th : Threads)
votes[th->rootMoves[0].pv[0]] += int(th->rootMoves[0].score - minScore)
+ int(th->completedDepth);
{
Depth depthDiff = th->completedDepth - bestThread->completedDepth;
Value scoreDiff = th->rootMoves[0].score - bestThread->rootMoves[0].score;

// Select best thread
int bestVote = votes[this->rootMoves[0].pv[0]];
for (Thread* th : Threads)
if (votes[th->rootMoves[0].pv[0]] > bestVote)
{
bestVote = votes[th->rootMoves[0].pv[0]];
// Select the thread with the best score, always if it is a mate
if ( scoreDiff > 0
&& (depthDiff >= 0 || th->rootMoves[0].score >= VALUE_MATE_IN_MAX_PLY))
bestThread = th;
}
}
}

previousScore = bestThread->rootMoves[0].score;

0 comments on commit cd6014f

Please sign in to comment.
You can’t perform that action at this time.