From e0a49d4a619546998a77056fa79487010d2e99b9 Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Mon, 6 Jul 2020 23:00:20 +0900 Subject: [PATCH] Fix #729 (scoreMean & scoreStdev) --- src/main/java/featurecat/lizzie/gui/LizzieFrame.java | 3 ++- src/main/java/featurecat/lizzie/gui/WinratePane.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/featurecat/lizzie/gui/LizzieFrame.java b/src/main/java/featurecat/lizzie/gui/LizzieFrame.java index 840c34329..db2f4d715 100644 --- a/src/main/java/featurecat/lizzie/gui/LizzieFrame.java +++ b/src/main/java/featurecat/lizzie/gui/LizzieFrame.java @@ -912,6 +912,7 @@ private void drawMoveStatistics(Graphics2D g, int posX, int posY, int width, int double curWR = stats.maxWinrate; // winrate on this move double curSM = stats.maxScoreMean; // mean score on this move boolean validWinrate = (stats.totalPlayouts > 0); // and whether it was actually calculated + boolean validScore = validWinrate; if (!validWinrate) { curWR = Lizzie.board.getHistory().getData().winrate; validWinrate = Lizzie.board.getHistory().getData().getPlayouts() > 0; @@ -967,7 +968,7 @@ private void drawMoveStatistics(Graphics2D g, int posX, int posY, int width, int setPanelFont(g, (int) (min(width, height) * 0.2)); String text = ""; - if (Lizzie.leelaz.isKataGo) { + if (Lizzie.leelaz.isKataGo && validScore) { double score = Lizzie.leelaz.scoreMean; if (Lizzie.board.getHistory().isBlacksTurn()) { if (Lizzie.config.showKataGoBoardScoreMean) { diff --git a/src/main/java/featurecat/lizzie/gui/WinratePane.java b/src/main/java/featurecat/lizzie/gui/WinratePane.java index 687a68485..c75d2d3a1 100644 --- a/src/main/java/featurecat/lizzie/gui/WinratePane.java +++ b/src/main/java/featurecat/lizzie/gui/WinratePane.java @@ -123,6 +123,7 @@ private void drawMoveStatistics(Graphics2D g, int posX, int posY, int width, int Leelaz.WinrateStats stats = Lizzie.leelaz.getWinrateStats(); double curWR = stats.maxWinrate; // winrate on this move boolean validWinrate = (stats.totalPlayouts > 0); // and whether it was actually calculated + boolean validScore = validWinrate; if (Lizzie.frame.isPlayingAgainstLeelaz && Lizzie.frame.playerIsBlack == !Lizzie.board.getHistory().getData().blackToPlay) { validWinrate = false; @@ -172,7 +173,7 @@ private void drawMoveStatistics(Graphics2D g, int posX, int posY, int width, int setPanelFont(g, (int) (min(width, height) * 0.2)); String text = ""; - if (Lizzie.leelaz.isKataGo) { + if (Lizzie.leelaz.isKataGo && validScore) { double score = Lizzie.leelaz.scoreMean; if (Lizzie.board.getHistory().isBlacksTurn()) { if (Lizzie.config.showKataGoBoardScoreMean) {