Skip to content

Commit

Permalink
Fixes SpeedTest
Browse files Browse the repository at this point in the history
  • Loading branch information
fathzer committed Jan 10, 2024
1 parent 230f641 commit ae34962
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/fathzer/jchess/uci/extended/SpeedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ public long run() {
final DeepeningPolicy policy = uciEngine.getEngine().getDeepeningPolicy();
int size = policy.getSize();
int accuracy = policy.getAccuracy();
int depth = policy.getDepth();
String fen = (uciEngine.isPositionSet() && uciEngine instanceof Displayable) ? ((Displayable)uciEngine).getFEN() : null;
try {
final long start = System.currentTimeMillis();
doSpeedTest();
return System.currentTimeMillis()-start;
} finally {
policy.setDepth(depth);
policy.setSize(size);
policy.setAccuracy(accuracy);
if (fen!=null) {
Expand All @@ -89,6 +91,7 @@ public long run() {
private void doSpeedTest() {
final DeepeningPolicy policy = uciEngine.getEngine().getDeepeningPolicy();
policy.setSize(Integer.MAX_VALUE);
policy.setDepth(8);

// 3 possible Mats in 1 with whites
Result<M> mv = fill("7k/5p2/5PQN/5PPK/6PP/8/8/8 w - - 6 5");
Expand Down

0 comments on commit ae34962

Please sign in to comment.