Package featurecat.lizzie.analysis
Class Leelaz
- java.lang.Object
-
- featurecat.lizzie.analysis.Leelaz
-
public class Leelaz extends java.lang.ObjectAn 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 classLeelaz.WinrateStats
-
Field Summary
Fields Modifier and Type Field Description booleanisSettingHandicapbooleanisThinkingstatic doublemHandicapWinrate
-
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 voidaddListener(LeelazListener listener)intcurrentEngineN()java.lang.StringcurrentWeight()java.lang.StringengineCommand()voidestimatePassWinrate()voidgenmove(java.lang.String color)java.util.List<MoveData>getBestMoves()java.util.Optional<java.lang.String>getDynamicKomi()Leelaz.WinrateStatsgetWinrateStats()booleanisLoaded()booleanisPondering()voidnormalQuit()voidplayMove(Stone color, java.lang.String move)voidremoveListener(LeelazListener listener)voidrestartEngine(java.lang.String engineCommand, int index)voidsendCommand(java.lang.String command)Sends a command to command queue for leelaz to executevoidshutdown()End the processvoidstartEngine(java.lang.String engineCommand)booleanswitching()voidtogglePonder()voidundo()static doublewinrateToHandicap(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()
-
-