Package featurecat.lizzie.analysis
Class Leelaz
- java.lang.Object
-
- featurecat.lizzie.analysis.Leelaz
-
public class Leelaz extends 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 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()StringcurrentWeight()StringengineCommand()voidestimatePassWinrate()voidgenmove(String color)List<MoveData>getBestMoves()Optional<String>getDynamicKomi()Leelaz.WinrateStatsgetWinrateStats()booleanisLoaded()booleanisPondering()voidnormalQuit()voidplayMove(Stone color, String move)voidremoveListener(LeelazListener listener)voidrestartEngine(String engineCommand, int index)voidsendCommand(String command)Sends a command to command queue for leelaz to executevoidshutdown()End the processvoidstartEngine(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).
-
-
-
Constructor Detail
-
Leelaz
public Leelaz() throws IOException, org.json.JSONExceptionInitializes the leelaz process and starts reading output- Throws:
IOExceptionorg.json.JSONException
-
-
Method Detail
-
startEngine
public void startEngine(String engineCommand) throws IOException
- Throws:
IOException
-
restartEngine
public void restartEngine(String engineCommand, int index) throws IOException
- Throws:
IOException
-
normalQuit
public void normalQuit()
-
sendCommand
public void sendCommand(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, String move)
- Parameters:
color- color of stone to playmove- coordinate of the coordinate
-
genmove
public void genmove(String color)
-
undo
public void undo()
-
togglePonder
public void togglePonder()
-
shutdown
public void shutdown()
End the process
-
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 String currentWeight()
-
switching
public boolean switching()
-
currentEngineN
public int currentEngineN()
-
engineCommand
public String engineCommand()
-
-