Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Dec 5, 2020
2 parents d97ca80 + 7787225 commit 472c3f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/main/java/featurecat/lizzie/gui/LizzieFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,18 @@ public void run() {
if (Lizzie.leelaz == null) return;
try {
int totalPlayouts = MoveData.getPlayouts(Lizzie.leelaz.getBestMoves());
if (totalPlayouts <= 0) return;
int recorderTotalPlayouts = Lizzie.board.getData().getPlayouts();
int displayedTotalPlayouts = Math.max(totalPlayouts, recorderTotalPlayouts);
if (displayedTotalPlayouts <= 0) return;
boolean showingRecorded =
(totalPlayouts < displayedTotalPlayouts) && (totalPlayouts > 0);
String backgroundTotalPlayoutsString =
showingRecorded ? String.format("%d/", totalPlayouts) : "";
visitsString =
String.format(
" %d playouts, %d visits/second",
totalPlayouts,
" %s%d playouts, %d visits/second",
backgroundTotalPlayoutsString,
displayedTotalPlayouts,
(totalPlayouts > lastPlayouts) ? totalPlayouts - lastPlayouts : 0);
updateTitle();
lastPlayouts = totalPlayouts;
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/featurecat/lizzie/gui/LizzieMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,18 @@ public void run() {
if (Lizzie.leelaz == null) return;
try {
int totalPlayouts = MoveData.getPlayouts(Lizzie.leelaz.getBestMoves());
if (totalPlayouts <= 0) return;
int recorderTotalPlayouts = Lizzie.board.getData().getPlayouts();
int displayedTotalPlayouts = Math.max(totalPlayouts, recorderTotalPlayouts);
if (displayedTotalPlayouts <= 0) return;
boolean showingRecorded =
(totalPlayouts < displayedTotalPlayouts) && (totalPlayouts > 0);
String backgroundTotalPlayoutsString =
showingRecorded ? String.format("%d/", totalPlayouts) : "";
visitsString =
String.format(
" %d playouts, %d visits/second",
totalPlayouts,
" %s%d playouts, %d visits/second",
backgroundTotalPlayoutsString,
displayedTotalPlayouts,
(totalPlayouts > lastPlayouts) ? totalPlayouts - lastPlayouts : 0);
updateTitle();
lastPlayouts = totalPlayouts;
Expand Down

0 comments on commit 472c3f5

Please sign in to comment.