Interface SearchMethod
- All Known Implementing Classes:
AlphaBeta
public interface SearchMethod
Defines the interface of a game tree search method.
-
Method Summary
Modifier and TypeMethodDescriptionintsearch()Conducts a search of the game tree and yields the best move.voidThe board state to search from.voidsetColor(byte color) Indicates which player we want the search to find the ideal move for.voidsetShowOutput(boolean show) Indicates that you want the search to print feedback to the console.voidsetTimeLimit(int seconds) Sets the a time constraint on the search.voidsetTimeLimitMs(long milliseconds) Sets a time constraint on the search.
-
Method Details
-
setBoard
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
SeeSearchMethod ab = new AlphaBeta(); ab.setColor(C.WHITE); // or C.BLACK.C -
search
int search()Conducts a search of the game tree and yields the best move.
The move will be encoded as anint. SeeMovefor information about how to use such a value.
-