Skip to content

Commit

Permalink
Merge #684
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Sep 28, 2020
2 parents 6392c6b + 93f2813 commit b2221b1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 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 @@ -739,7 +739,6 @@ public boolean isPondering() {

public class WinrateStats {
public double maxWinrate;
public double maxScoreMean;
public int totalPlayouts;

public WinrateStats(double maxWinrate, int totalPlayouts) {
Expand Down Expand Up @@ -767,9 +766,6 @@ public WinrateStats getWinrateStats() {
stats.totalPlayouts = totalPlayouts;

stats.maxWinrate = BoardData.getWinrateFromBestMoves(moves);
if (isKataGo) {
stats.maxScoreMean = BoardData.getScoreMeanFromBestMoves(moves);
}
}

return stats;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/featurecat/lizzie/gui/LizzieFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,6 @@ 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
double curSM = stats.maxScoreMean; // mean score on this move
boolean validWinrate = (stats.totalPlayouts > 0); // and whether it was actually calculated
if (!validWinrate) {
curWR = Lizzie.board.getHistory().getData().winrate;
Expand All @@ -924,13 +923,11 @@ private void drawMoveStatistics(Graphics2D g, int posX, int posY, int width, int
if (!validWinrate) {
curWR = 100 - lastWR; // display last move's winrate for now (with color difference)
}
double whiteWR, blackWR, blackSM;
double whiteWR, blackWR;
if (Lizzie.board.getData().blackToPlay) {
blackWR = curWR;
blackSM = curSM;
} else {
blackWR = 100 - curWR;
blackSM = -curSM;
}

whiteWR = 100 - blackWR;
Expand Down Expand Up @@ -1044,14 +1041,6 @@ private void drawMoveStatistics(Graphics2D g, int posX, int posY, int width, int
winString,
barPosxB + maxBarwidth - sw - 2 * strokeRadius,
posY + barHeight - 2 * strokeRadius);
if (Lizzie.leelaz.isKataGo) {
String scoreString = String.format("%.1f", blackSM);
sw = g.getFontMetrics().stringWidth(scoreString);
g.drawString(
scoreString,
barPosxB + maxBarwidth / 2 - sw / 2 - strokeRadius,
posY + barHeight - 2 * strokeRadius);
}

g.setColor(Color.GRAY);
Stroke oldstroke = g.getStroke();
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/featurecat/lizzie/rules/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -1468,9 +1468,6 @@ public void updateWinrate() {
Leelaz.WinrateStats stats = Lizzie.leelaz.getWinrateStats();
if (stats.maxWinrate >= 0 && stats.totalPlayouts > history.getData().getPlayouts()) {
history.getData().winrate = stats.maxWinrate;
if (Lizzie.leelaz.isKataGo) {
history.getData().scoreMean = stats.maxScoreMean;
}
// we won't set playouts here. but setting winrate is ok... it shows the user that we are
// computing. i think its fine.
}
Expand Down

0 comments on commit b2221b1

Please sign in to comment.