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

      • isSettingHandicap

        public boolean isSettingHandicap
      • isThinking

        public boolean isThinking
      • mHandicapWinrate

        public static double mHandicapWinrate
    • Constructor Detail

      • Leelaz

        public Leelaz()
               throws IOException,
                      org.json.JSONException
        Initializes the leelaz process and starts reading output
        Throws:
        IOException
        org.json.JSONException
    • Method Detail

      • 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 play
        move - 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()
      • 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 String currentWeight()
      • switching

        public boolean switching()
      • currentEngineN

        public int currentEngineN()
      • engineCommand

        public String engineCommand()