Package featurecat.lizzie.analysis
Class Leelaz
- java.lang.Object
-
- featurecat.lizzie.analysis.Leelaz
-
public class Leelaz extends java.lang.Object
An interface with leelaz go engine. Can be adapted for GTP, but is specifically designed for GCP's Leela Zero. leelaz is modified to output information as it ponders see www.github.com/gcp/leela-zero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Leelaz.WinrateStats
-
Field Summary
Fields Modifier and Type Field Description boolean
isSettingHandicap
boolean
isThinking
static double
mHandicapWinrate
-
Constructor Summary
Constructors Constructor Description Leelaz()
Initializes the leelaz process and starts reading output
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(LeelazListener listener)
int
currentEngineN()
java.lang.String
currentWeight()
java.lang.String
engineCommand()
void
estimatePassWinrate()
void
genmove(java.lang.String color)
java.util.List<MoveData>
getBestMoves()
java.util.Optional<java.lang.String>
getDynamicKomi()
Leelaz.WinrateStats
getWinrateStats()
boolean
isLoaded()
boolean
isPondering()
void
normalQuit()
void
playMove(Stone color, java.lang.String move)
void
removeListener(LeelazListener listener)
void
restartEngine(java.lang.String engineCommand, int index)
void
sendCommand(java.lang.String command)
Sends a command to command queue for leelaz to executevoid
shutdown()
End the processvoid
startEngine(java.lang.String engineCommand)
boolean
switching()
void
togglePonder()
void
undo()
static double
winrateToHandicap(double pWinrate)
Convert winrate to handicap stones, by normalizing winrate by first move pass winrate (one stone handicap).
-
-
-
Method Detail
-
startEngine
public void startEngine(java.lang.String engineCommand) throws java.io.IOException
- Throws:
java.io.IOException
-
restartEngine
public void restartEngine(java.lang.String engineCommand, int index) throws java.io.IOException
- Throws:
java.io.IOException
-
normalQuit
public void normalQuit()
-
sendCommand
public void sendCommand(java.lang.String command)
Sends a command to command queue for leelaz to execute- Parameters:
command
- a GTP command containing no newline characters
-
playMove
public void playMove(Stone color, java.lang.String move)
- Parameters:
color
- color of stone to playmove
- coordinate of the coordinate
-
genmove
public void genmove(java.lang.String color)
-
undo
public void undo()
-
togglePonder
public void togglePonder()
-
shutdown
public void shutdown()
End the process
-
getBestMoves
public java.util.List<MoveData> getBestMoves()
-
getDynamicKomi
public java.util.Optional<java.lang.String> getDynamicKomi()
-
isPondering
public boolean isPondering()
-
getWinrateStats
public Leelaz.WinrateStats getWinrateStats()
-
estimatePassWinrate
public void estimatePassWinrate()
-
winrateToHandicap
public static double winrateToHandicap(double pWinrate)
Convert winrate to handicap stones, by normalizing winrate by first move pass winrate (one stone handicap).
-
addListener
public void addListener(LeelazListener listener)
-
removeListener
public void removeListener(LeelazListener listener)
-
isLoaded
public boolean isLoaded()
-
currentWeight
public java.lang.String currentWeight()
-
switching
public boolean switching()
-
currentEngineN
public int currentEngineN()
-
engineCommand
public java.lang.String engineCommand()
-
-