Skip to content

Commit

Permalink
Don't parse MoveData order
Browse files Browse the repository at this point in the history
Moves are always outputed in order by leelaz, so this processing this
info is redundent. Furthermore, summary lines do not include any order,
so we can only rely on print order for these. This commit remove the
order field, and remove the Comparable interface from MoveData.
  • Loading branch information
OlivierBlanvillain committed Sep 17, 2018
1 parent efc8fe3 commit 5b0e755
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 0 additions & 4 deletions src/main/java/featurecat/lizzie/analysis/Leelaz.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,11 @@ private void initializeStreams() {
}

private void parseInfo(String line) {

bestMoves = new ArrayList<>();
String[] variations = line.split(" info ");
for (String var : variations) {
bestMoves.add(MoveData.fromInfo(var));
}
// Not actually necessary to sort with current version of LZ (0.15)
// but not guaranteed to be ordered in the future
Collections.sort(bestMoves);
}

/**
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/featurecat/lizzie/analysis/MoveData.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@
/**
* Holds the data from Leelaz's pondering mode
*/
public class MoveData implements Comparable<MoveData> {
public class MoveData {
public String coordinate;
public int playouts;
public double winrate;
public int order;
public List<String> variation;

private MoveData() {}

public int compareTo(MoveData b) {
return order - b.order;
}

/**
* Parses a leelaz ponder output line. For example:
*
Expand Down Expand Up @@ -52,7 +47,6 @@ public static MoveData fromInfo(String line) throws ArrayIndexOutOfBoundsExcepti
}
}
}

return result;
}

Expand Down

0 comments on commit 5b0e755

Please sign in to comment.