mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
CuckooChess: Implemented late move pruning.
This commit is contained in:
parent
c53f582581
commit
7168e4be6e
|
@ -30,7 +30,7 @@ public class ComputerPlayer implements Player {
|
|||
public static final String engineName;
|
||||
|
||||
static {
|
||||
String name = "CuckooChess 1.13a7";
|
||||
String name = "CuckooChess 1.13a8";
|
||||
String m = System.getProperty("sun.arch.data.model");
|
||||
if ("32".equals(m))
|
||||
name += " 32-bit";
|
||||
|
|
|
@ -712,8 +712,16 @@ public class Search {
|
|||
boolean mayReduce = (m.score < 53) && (!isCapture || m.score < 0) && !isPromotion;
|
||||
boolean givesCheck = MoveGen.givesCheck(pos, m);
|
||||
boolean doFutility = false;
|
||||
if (futilityPrune && mayReduce && haveLegalMoves) {
|
||||
if (!givesCheck && !passedPawnPush(pos, m))
|
||||
if (mayReduce && haveLegalMoves && !givesCheck && !passedPawnPush(pos, m)) {
|
||||
int moveCountLimit;
|
||||
if (depth <= plyScale) moveCountLimit = 3;
|
||||
else if (depth <= 2 * plyScale) moveCountLimit = 6;
|
||||
else if (depth <= 3 * plyScale) moveCountLimit = 12;
|
||||
else if (depth <= 4 * plyScale) moveCountLimit = 24;
|
||||
else moveCountLimit = 256;
|
||||
if (mi >= moveCountLimit)
|
||||
continue; // Late move pruning
|
||||
if (futilityPrune)
|
||||
doFutility = true;
|
||||
}
|
||||
int score;
|
||||
|
|
|
@ -177,7 +177,7 @@ public class SearchTest {
|
|||
pos = TextIO.readFEN("7k/5RR1/8/8/8/8/1q3q2/3K4 w - - 0 1");
|
||||
sc = new Search(pos, nullHist, 0, tt);
|
||||
sc.maxTimeMillis = -1;
|
||||
score = idSearch(sc, 3).score;
|
||||
score = idSearch(sc, 4).score;
|
||||
assertTrue(score < 0);
|
||||
|
||||
pos = TextIO.readFEN("7k/5RR1/8/8/8/8/1q3q2/3K4 w - - 0 1");
|
||||
|
|
Loading…
Reference in New Issue
Block a user