Class 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
    • Field Detail

      • isSettingHandicap

        public boolean isSettingHandicap
      • isThinking

        public boolean isThinking
      • mHandicapWinrate

        public static double mHandicapWinrate
    • Constructor Detail

      • Leelaz

        public Leelaz()
               throws java.io.IOException,
                      org.json.JSONException
        Initializes the leelaz process and starts reading output
        Throws:
        java.io.IOException
        org.json.JSONException
    • 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 play
        move - 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()
      • 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).
      • 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()