mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 17:12:40 +01:00
DroidFish: Don't generate the same move list twice when EGTB "probe at root" is enabled.
This commit is contained in:
@@ -332,12 +332,13 @@ public class DroidComputerPlayer {
|
|||||||
/** Decide what moves to search. Filters out non-optimal moves if tablebases are used. */
|
/** Decide what moves to search. Filters out non-optimal moves if tablebases are used. */
|
||||||
private final ArrayList<Move> movesToSearch(SearchRequest sr) {
|
private final ArrayList<Move> movesToSearch(SearchRequest sr) {
|
||||||
ArrayList<Move> moves = null;
|
ArrayList<Move> moves = null;
|
||||||
|
ArrayList<Move> legalMoves = new MoveGen().legalMoves(sr.currPos);
|
||||||
if (engineOptions.rootProbe)
|
if (engineOptions.rootProbe)
|
||||||
moves = Probe.getInstance().findOptimal(sr.currPos);
|
moves = Probe.getInstance().removeNonOptimal(sr.currPos, legalMoves);
|
||||||
if (moves != null) {
|
if (moves != null) {
|
||||||
sr.searchMoves = moves;
|
sr.searchMoves = moves;
|
||||||
} else {
|
} else {
|
||||||
moves = new MoveGen().legalMoves(sr.currPos);
|
moves = legalMoves;
|
||||||
sr.searchMoves = null;
|
sr.searchMoves = null;
|
||||||
}
|
}
|
||||||
return moves;
|
return moves;
|
||||||
|
|||||||
@@ -177,10 +177,9 @@ public class Probe {
|
|||||||
return ret;
|
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. */
|
* Returns null if no legal move could be excluded. */
|
||||||
public final ArrayList<Move> findOptimal(Position pos) {
|
public final ArrayList<Move> removeNonOptimal(Position pos, ArrayList<Move> moveList) {
|
||||||
ArrayList<Move> moveList = new MoveGen().legalMoves(pos);
|
|
||||||
ArrayList<Move> optimalMoves = new ArrayList<Move>();
|
ArrayList<Move> optimalMoves = new ArrayList<Move>();
|
||||||
ArrayList<Move> unknownMoves = new ArrayList<Move>();
|
ArrayList<Move> unknownMoves = new ArrayList<Move>();
|
||||||
final int MATE0 = 100000;
|
final int MATE0 = 100000;
|
||||||
|
|||||||
Reference in New Issue
Block a user