Skip to content

Commit

Permalink
Support "showPolicy" in the tool bar for Leela 0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Nov 18, 2020
1 parent c540194 commit 416eaae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/featurecat/lizzie/analysis/MoveData.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ public static MoveData fromSummary(String summary) {
result.coordinate = matchold.group(1);
result.playouts = Integer.parseInt(matchold.group(2));
result.winrate = Double.parseDouble(matchold.group(3));
if (Lizzie.leelaz.isLeela0110) result.policy = Double.parseDouble(matchold.group(4));
result.variation =
Arrays.asList(matchold.group(4).split(" ", Lizzie.config.limitBranchLength));
Arrays.asList(matchold.group(5).split(" ", Lizzie.config.limitBranchLength));
return result;
}
} else {
Expand All @@ -182,10 +183,12 @@ public static MoveData fromSummary(String summary) {
Pattern.compile(
"^ *(\\w\\d*) -> *(\\d+) \\(V: ([^%)]+)%\\) \\(LCB: ([^%)]+)%\\) \\([^\\)]+\\) PV: (.+).*$");
private static Pattern summaryPatternWinrate =
Pattern.compile("^ *(\\w\\d*) -> *(\\d+) \\(V: ([^%)]+)%\\) \\([^\\)]+\\) PV: (.+).*$");
Pattern.compile("^ *(\\w\\d*) -> *(\\d+) \\(V: ([^%)]+)%\\) \\([^\\)]+\\) ()PV: (.+).*$");
// dummy () before "PV" for compatibility with summaryPatternLeela0110
// support 0.16 0.15
private static Pattern summaryPatternLeela0110 =
Pattern.compile("^ *(\\w\\d*) -> *(\\d+) \\(W: ([^%)]+)%\\).*PV: (.+).*$");
Pattern.compile(
"^ *(\\w\\d*) -> *(\\d+) \\(W: ([^%)]+)%\\).* \\(N: ([^%)]+)%\\) PV: (.+).*$");

public static int getPlayouts(List<MoveData> moves) {
int playouts = 0;
Expand Down

0 comments on commit 416eaae

Please sign in to comment.