DroidFish: Don't generate the same move list twice when EGTB "probe at root" is enabled.

This commit is contained in:
Peter Osterlund
2012-12-29 20:17:26 +00:00
parent 8fae287145
commit 0cb50f4e26
2 changed files with 5 additions and 5 deletions

View File

@@ -332,12 +332,13 @@ public class DroidComputerPlayer {
/** Decide what moves to search. Filters out non-optimal moves if tablebases are used. */
private final ArrayList<Move> movesToSearch(SearchRequest sr) {
ArrayList<Move> moves = null;
ArrayList<Move> legalMoves = new MoveGen().legalMoves(sr.currPos);
if (engineOptions.rootProbe)
moves = Probe.getInstance().findOptimal(sr.currPos);
moves = Probe.getInstance().removeNonOptimal(sr.currPos, legalMoves);
if (moves != null) {
sr.searchMoves = moves;
} else {
moves = new MoveGen().legalMoves(sr.currPos);
moves = legalMoves;
sr.searchMoves = null;
}
return moves;

View File

@@ -177,10 +177,9 @@ public class Probe {
return ret;
}
/** Return a list of all legal moves that are not known to be non-optimal.
/** Return a list of all moves in moveList that are not known to be non-optimal.
* Returns null if no legal move could be excluded. */
public final ArrayList<Move> findOptimal(Position pos) {
ArrayList<Move> moveList = new MoveGen().legalMoves(pos);
public final ArrayList<Move> removeNonOptimal(Position pos, ArrayList<Move> moveList) {
ArrayList<Move> optimalMoves = new ArrayList<Move>();
ArrayList<Move> unknownMoves = new ArrayList<Move>();
final int MATE0 = 100000;