Skip to content

Commit

Permalink
Disable "Avoid Keep Variations" if it is 0 (ref. featurecat#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Oct 10, 2020
1 parent 29507eb commit 9cd6baf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/featurecat/lizzie/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ public boolean showBranchNow() {
return showBranch || showBestMovesTemporarily;
}

public boolean useAvoidInAnalysis() {
return config.getJSONObject("leelaz").getInt("avoid-keep-variations") > 0;
}

/**
* Scans the current directory as well as the current PATH to find a reasonable default leelaz
* binary.
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/featurecat/lizzie/analysis/Leelaz.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,10 @@ public void analyzeAvoid(String parameters) {
public void ponder() {
isPondering = true;
startPonderTime = System.currentTimeMillis();
if (Lizzie.board.isAvoding && Lizzie.board.isKeepingAvoid && !isKataGo)
if (Lizzie.board.isAvoding
&& Lizzie.board.isKeepingAvoid
&& !isKataGo
&& Lizzie.config.useAvoidInAnalysis())
analyzeAvoid(
"avoid b "
+ Lizzie.board.avoidCoords
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/featurecat/lizzie/gui/LizzieFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,9 @@ public boolean openRightClickMenu(int x, int y) {
if (isPlayingAgainstLeelaz) {
return false;
}
if (!Lizzie.config.useAvoidInAnalysis()) {
return false;
}
if (Lizzie.leelaz.isPondering()) {
Lizzie.leelaz.sendCommand("name");
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/featurecat/lizzie/gui/LizzieMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ public boolean openRightClickMenu(int x, int y) {
if (isPlayingAgainstLeelaz) {
return false;
}
if (!Lizzie.config.useAvoidInAnalysis()) {
return false;
}
if (Lizzie.leelaz.isPondering()) {
Lizzie.leelaz.sendCommand("name");
}
Expand Down

0 comments on commit 9cd6baf

Please sign in to comment.