Interface SearchMethod

All Known Implementing Classes:
AlphaBeta

public interface SearchMethod
Defines the interface of a game tree search method.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Conducts a search of the game tree and yields the best move.
    void
    setBoard(State board)
    The board state to search from.
    void
    setColor(byte color)
    Indicates which player we want the search to find the ideal move for.
    void
    setShowOutput(boolean show)
    Indicates that you want the search to print feedback to the console.
    void
    setTimeLimit(int seconds)
    Sets the a time constraint on the search.
    void
    setTimeLimitMs(long milliseconds)
    Sets a time constraint on the search.
  • Method Details

    • setBoard

      void setBoard(State board)
      The board state to search from.
    • setTimeLimit

      void setTimeLimit(int seconds)
      Sets the a time constraint on the search.
    • setTimeLimitMs

      void setTimeLimitMs(long milliseconds)
      Sets a time constraint on the search.
    • setShowOutput

      void setShowOutput(boolean show)
      Indicates that you want the search to print feedback to the console.
    • setColor

      void setColor(byte color)
      Indicates which player we want the search to find the ideal move for.

      Example
      SearchMethod ab = new AlphaBeta();
      ab.setColor(C.WHITE); // or C.BLACK.
      
      See C
    • search

      int search()
      Conducts a search of the game tree and yields the best move.

      The move will be encoded as an int. See Move for information about how to use such a value.