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 Board
board
static int
engineIndex
boolean
gtpConsole
boolean
isAttached
boolean
isInputCommand
boolean
isKataGo
boolean
isSettingHandicap
boolean
isThinking
static double
mHandicapWinrate
boolean
preload
double
scoreMean
double
scoreStdev
boolean
supportScoremean
-
Constructor Summary
Constructors Constructor Description Leelaz(java.lang.String engineCommand)
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)
void
analyzeAvoid(java.lang.String parameters)
void
analyzeAvoid(java.lang.String type, java.lang.String color, java.lang.String coordList, int untilMove)
void
beginModifyingBoard()
void
boardSize(int size)
void
boardSize(int width, int height)
void
clear()
int
currentEngineN()
java.lang.String
currentShortWeight()
java.lang.String
currentWeight()
void
endModifyingBoard()
java.lang.String
engineCommand()
void
estimatePassWinrate()
void
genmove(java.lang.String color)
void
genmove_analyze(java.lang.String color)
java.util.List<MoveData>
getBestMoves()
java.util.Optional<java.lang.String>
getDynamicKomi()
Leelaz.WinrateStats
getWinrateStats()
void
handicap(int num)
boolean
isCommandChange(java.lang.String command)
boolean
isDown()
boolean
isLoaded()
boolean
isPondering()
boolean
isStarted()
void
komi(double komi)
void
normalQuit()
java.util.List<MoveData>
parseInfo(java.lang.String line)
java.util.List<MoveData>
parseInfoKatago(java.lang.String line)
void
playMove(Stone color, java.lang.String move)
void
ponder()
This initializes leelaz's pondering mode at its current positionvoid
removeListener(LeelazListener listener)
void
restartEngine()
void
sendCommand(java.lang.String command)
Sends a command to command queue for leelaz to executevoid
sendToWriterThread(java.lang.String command)
void
setWeightName()
void
shutdown()
End the processjava.util.List<java.lang.String>
splitCommand(java.lang.String commandLine)
void
startEngine()
void
startWriterThread()
void
stopWriterThread()
boolean
supportScoremean()
boolean
switching()
void
time_settings()
void
toggleGtpConsole()
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).
-
-
-
Field Detail
-
gtpConsole
public boolean gtpConsole
-
board
public Board board
-
isAttached
public boolean isAttached
-
isSettingHandicap
public boolean isSettingHandicap
-
isThinking
public boolean isThinking
-
isInputCommand
public boolean isInputCommand
-
preload
public boolean preload
-
isKataGo
public boolean isKataGo
-
supportScoremean
public boolean supportScoremean
-
scoreMean
public double scoreMean
-
scoreStdev
public double scoreStdev
-
engineIndex
public static int engineIndex
-
mHandicapWinrate
public static double mHandicapWinrate
-
-
Method Detail
-
startEngine
public void startEngine() throws java.io.IOException
- Throws:
java.io.IOException
-
restartEngine
public void restartEngine() throws java.io.IOException
- Throws:
java.io.IOException
-
normalQuit
public void normalQuit()
-
parseInfo
public java.util.List<MoveData> parseInfo(java.lang.String line)
-
parseInfoKatago
public java.util.List<MoveData> parseInfoKatago(java.lang.String line)
-
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
-
beginModifyingBoard
public void beginModifyingBoard()
-
endModifyingBoard
public void endModifyingBoard()
-
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)
-
genmove_analyze
public void genmove_analyze(java.lang.String color)
-
time_settings
public void time_settings()
-
clear
public void clear()
-
boardSize
public void boardSize(int size)
-
boardSize
public void boardSize(int width, int height)
-
komi
public void komi(double komi)
-
handicap
public void handicap(int num)
-
undo
public void undo()
-
analyzeAvoid
public void analyzeAvoid(java.lang.String type, java.lang.String color, java.lang.String coordList, int untilMove)
-
analyzeAvoid
public void analyzeAvoid(java.lang.String parameters)
-
ponder
public void ponder()
This initializes leelaz's pondering mode at its current position
-
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)
-
splitCommand
public java.util.List<java.lang.String> splitCommand(java.lang.String commandLine)
-
isCommandChange
public boolean isCommandChange(java.lang.String command)
-
isStarted
public boolean isStarted()
-
isLoaded
public boolean isLoaded()
-
isDown
public boolean isDown()
-
supportScoremean
public boolean supportScoremean()
-
currentWeight
public java.lang.String currentWeight()
-
currentShortWeight
public java.lang.String currentShortWeight()
-
switching
public boolean switching()
-
currentEngineN
public int currentEngineN()
-
engineCommand
public java.lang.String engineCommand()
-
toggleGtpConsole
public void toggleGtpConsole()
-
setWeightName
public void setWeightName()
-
startWriterThread
public void startWriterThread()
-
stopWriterThread
public void stopWriterThread()
-
sendToWriterThread
public void sendToWriterThread(java.lang.String command)
-
-