Package featurecat.lizzie.analysis
Class Leelaz
java.lang.Object
featurecat.lizzie.analysis.Leelaz
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intbooleanbooleanbooleanbooleanbooleanbooleanstatic doublebooleandoubledoubleboolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(LeelazListener listener) voidanalyzeAvoid(String parameters) voidanalyzeAvoid(String type, String color, String coordList, int untilMove) voidvoidboardSize(int size) voidboardSize(int width, int height) voidclear()intvoidvoidvoidvoidgenmove_analyze(String color) voidhandicap(int num) booleanisCommandChange(String command) booleanisDown()booleanisLoaded()booleanbooleanvoidkomi(double komi) voidparseInfoKatago(String line) voidvoidponder()This initializes leelaz's pondering mode at its current positionvoidremoveListener(LeelazListener listener) voidvoidsendCommand(String command) Sends a command to command queue for leelaz to executevoidsendToWriterThread(String command) voidvoidshutdown()End the processsplitCommand(String commandLine) voidvoidvoidbooleanbooleanvoidvoidvoidvoidundo()static doublewinrateToHandicap(double pWinrate) Convert winrate to handicap stones, by normalizing winrate by first move pass winrate (one stone handicap).
-
Field Details
-
gtpConsole
public boolean gtpConsole -
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
-
-
Constructor Details
-
Leelaz
Initializes the leelaz process and starts reading output- Throws:
IOExceptionorg.json.JSONException
-
-
Method Details
-
startEngine
- Throws:
IOException
-
restartEngine
- Throws:
IOException
-
normalQuit
public void normalQuit() -
parseInfo
-
parseInfoKatago
-
sendCommand
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
- Parameters:
color- color of stone to playmove- coordinate of the coordinate
-
genmove
-
genmove_analyze
-
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
-
analyzeAvoid
-
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
-
getDynamicKomi
-
isPondering
public boolean isPondering() -
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
-
removeListener
-
splitCommand
-
isCommandChange
-
isStarted
public boolean isStarted() -
isLoaded
public boolean isLoaded() -
isDown
public boolean isDown() -
supportScoremean
public boolean supportScoremean() -
currentWeight
-
currentShortWeight
-
switching
public boolean switching() -
currentEngineN
public int currentEngineN() -
engineCommand
-
toggleGtpConsole
public void toggleGtpConsole() -
setWeightName
public void setWeightName() -
startWriterThread
public void startWriterThread() -
stopWriterThread
public void stopWriterThread() -
sendToWriterThread
-