|
Holger's Java API |
|||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||
| Packages that use GamePlay | |
|---|---|
| com.antelmann.game | This package contains packages to support game implementations. |
| com.antelmann.game.awari | This package contains an implementation of the game Awari. |
| com.antelmann.game.card | This package contains classes to serve card games and also includes a full implementation of BlackJack. |
| com.antelmann.game.checkers | This package contains an implementation of the game checkers. |
| com.antelmann.game.chess | This package contains an implementation of the game chess. |
| com.antelmann.game.fourwins | This package contains a reference implementation of the game Four-Connects or 4-wins or 4-in-a-row. |
| com.antelmann.game.gomoku | This package contains an implementation of the game Go-moku. |
| com.antelmann.game.mine | This package contains an implementation of the game MineSweeper. |
| com.antelmann.game.muehle | This package contains a reference implementation of the game "Mühle" (as it is known in German) or "Nine Men's Morris". |
| com.antelmann.game.puzzle | This package contains single-user game implementations representing puzzles. |
| com.antelmann.game.reversi | This package contains an implementation of the game Reversi or Othello. |
| com.antelmann.game.ttt | This package simply contains an implementation of the game Tick Tack Toe. |
| com.antelmann.game.wolfsheep | This package contains an implementation of the game Wolf&Sheep. |
| Uses of GamePlay in com.antelmann.game |
|---|
| Classes in com.antelmann.game that implement GamePlay | |
|---|---|
class |
AbstractGame
This class implements the generic behaviour of a game to ease GamePlay implementations. |
| Methods in com.antelmann.game that return GamePlay | |
|---|---|
static GamePlay |
GameUtilities.bestFirstSearch(GamePlay game,
int[] roles,
int maxNumberOfNodes,
Player player,
Monitor monitor)
A 'best-first-search' algorithm that looks for a path to win the game according to the given roles. |
static GamePlay |
GameUtilities.breadthFirstSearch(GamePlay game,
int[] roles,
int numberOfMoves,
Monitor monitor)
breadthFirstSearch() is a 'breadth-first-search' puzzle-solver. |
static GamePlay |
GameUtilities.depthFirstSearch(GamePlay game,
int[] roles,
int numberOfMoves,
Monitor monitor)
depthFirstSearch() is a 'dfs puzzle-solver' that tries to find a path to a winning game position defined by the given roles within the given number of moves. |
static GamePlay |
GameUtilities.depthFirstSearch(GamePlay game,
int[] roles,
int numberOfMoves,
Player player,
Monitor monitor)
This depthFirstSearch() variant sorts the moves according to their heuristics provided by the given player before performing its otherwise 'depth-first-search' algorithm. |
GamePlay |
GameRuntimeException.getGame()
|
GamePlay |
GameException.getGame()
|
GamePlay |
GameDriver.getGame()
|
GamePlay |
CannotPlayGameException.getGame()
|
GamePlay |
AutoPlay.getGame()
returns the underlying GamePlay object |
GamePlay |
GamePlay.spawnChild(GameMove move)
spawnChild returns a deep copy of an identical game that represents the status of the game after the given move is carried out. |
GamePlay |
AbstractGame.spawnChild(GameMove move)
spawnChild() creates a clone of the current game and advances the game by the given GameMove. |
| Methods in com.antelmann.game with parameters of type GamePlay | |
|---|---|
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
boolean orderMoves)
This function implements Alpha-Beta Search algorithm (intelligently pruned MinMax algorithm) and returns the evaluation given by the player's heuristic functions at the leaves; limited only by deepening level. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
double alpha,
double beta,
boolean orderMoves)
This function is usually just called by the other corresponding alphaBetaSearch function. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
double alpha,
double beta,
long time,
boolean orderMoves)
This function is usually just called by the other timed alphaBetaSearch function. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
double alpha,
double beta,
Monitor monitor,
boolean orderMoves)
This function is usually just called by the other corresponding monitored alphaBetaSearch function. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
long time,
boolean orderMoves)
This function implements Alpha-Beta Search algorithm (intelligently pruned MinMax algorithm) and returns the evaluation given by the player's heuristic functions at the leaves - timed version (search cut off at given time). |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
Monitor monitor,
boolean orderMoves)
This function implements Alpha-Beta Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves (intelligently pruned MinMax algorithm) - monitor version (search is cut off when monitor disabled). |
static GamePlay |
GameUtilities.bestFirstSearch(GamePlay game,
int[] roles,
int maxNumberOfNodes,
Player player,
Monitor monitor)
A 'best-first-search' algorithm that looks for a path to win the game according to the given roles. |
static GamePlay |
GameUtilities.breadthFirstSearch(GamePlay game,
int[] roles,
int numberOfMoves,
Monitor monitor)
breadthFirstSearch() is a 'breadth-first-search' puzzle-solver. |
boolean |
SocketPlayer.canPlayGame(GamePlay game)
|
boolean |
RandomPlayer.canPlayGame(GamePlay game)
always returns true, since the RandomPlayer can play any game |
boolean |
Player.canPlayGame(GamePlay game)
canPlayGame() returns true only if the Player provides an applicable heuristic for the type of game given. |
boolean |
BookPlayer.canPlayGame(GamePlay game)
|
static int |
GameUtilities.checkForWin(GamePlay game,
int[] role)
This convenience function checks whether there is a winner in the game corresponding to one of the given roles in the array; if so, it returns 1 in case the Player is among the winners, and -1 if that's not the case; a zero is returned if there are no winners or if GamePlay.getWinner() returns null. |
static GamePlay |
GameUtilities.depthFirstSearch(GamePlay game,
int[] roles,
int numberOfMoves,
Monitor monitor)
depthFirstSearch() is a 'dfs puzzle-solver' that tries to find a path to a winning game position defined by the given roles within the given number of moves. |
static GamePlay |
GameUtilities.depthFirstSearch(GamePlay game,
int[] roles,
int numberOfMoves,
Player player,
Monitor monitor)
This depthFirstSearch() variant sorts the moves according to their heuristics provided by the given player before performing its otherwise 'depth-first-search' algorithm. |
double |
TemplatePlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
This method will simply call the protected evaluate() method and in addition track the call if tracking is enabled. |
double |
SocketPlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
|
double |
Player.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
evaluate() asks the Player to rate a move in the context of a given game stage relative to its role (if the Player has multiple roles in the game, they will all be found in the role array - giving the Player maximum flexibility) while considering the game level for potential game tree search operations and then using heuristic() to evaluate the leaves of the game tree. |
double |
BookPlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
|
protected double |
TemplatePlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds,
Monitor monitor)
Internal evaluate function called by public evaluate() and selectMove(). |
static GameMove[] |
GameUtilities.getLegalMovesSorted(GamePlay game,
Player player,
int[] roles,
boolean descending)
getLegalMovesSorted() sorts the legal moves of the given game descending or ascending by their heuristic calculated by the given player based on the roles. |
double |
SocketPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
double |
RandomPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
Preserves the knowlege of whether the move wins or looses the game only if getCheckForWin() returns true; return values are then randomized unless the random seed is set to 0. |
double |
Player.heuristic(GamePlay game,
GameMove move,
int[] role)
This function - often used as a callback function - evaluates the given move in the context of the given game; it is expected to return quickly. |
double |
BookPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
static double |
GameUtilities.minMaxSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level)
implements MinMax Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves; limited only by a deepening level |
static double |
GameUtilities.minMaxSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
long time)
implements MinMax Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves; will only run as deep as given by the level and only as long as given time is less than System.currentTimeMillis(). |
static double |
GameUtilities.minMaxSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
Monitor monitor)
implements MinMax Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves; tracking is enabled tracking through a Monitor object. |
void |
GameObserver.movePerformed(GamePlay game)
called after a move is played; the game is to remain untouched. |
boolean |
TemplatePlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
unless overridden, this method returns always false |
boolean |
SocketPlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
|
boolean |
Player.pruneMove(GamePlay game,
GameMove move,
int[] role)
This method allows the Player to prune a game tree branch by determining that a particular move is not to be considered for further recursive tree search; this method is expected to return quickly. |
boolean |
BookPlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
|
GameMove |
TemplatePlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
This implementation selects the best move according to the given configuration. |
GameMove |
SocketPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
|
GameMove |
Player.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
selectMove() asks the Player to select a move out of GamePlay.legalMove() based on the role it plays; milliseconds is an indication of how long the calling function is willing to wait for an answer before continuing with potentially a randomMove or something else. |
GameMove |
BookPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
first checks the embedded book for a pre-stored move |
| Method parameters in com.antelmann.game with type arguments of type GamePlay | |
|---|---|
void |
BookPlayer.setBook(Hashtable<GamePlay,GameMove> book)
Sets the internal book used by this BookPlayer. |
| Constructors in com.antelmann.game with parameters of type GamePlay | |
|---|---|
CannotPlayGameException(Player player,
GamePlay game,
String customText)
|
|
GameDriver(GamePlay game)
initializes with RandomPlayer objects and level 0 |
|
GameDriver(GamePlay game,
Player[] players,
int level)
|
|
GameException(GamePlay game,
String text)
|
|
GameRuntimeException(GamePlay game,
String errorText)
|
|
GameRuntimeException(GamePlay game,
String errorText,
Throwable cause)
|
|
GameServer(int serverPort,
GamePlay game,
int timeout,
Logger logger)
|
|
JDefaultGame(GamePlay game)
|
|
JDefaultGame(GamePlay game,
Player[] player,
int level,
ExtensionFileFilter filter)
|
|
JGameFrame(GamePlay game)
this constructor uses a standard JDefaultGame object to wrap the given game and then calls JGameFrame(JGamePlay jplay) |
|
JPlayerClient(GamePlay game)
this constructor uses a standard JDefaultGame object to wrap the given game and then calls JGameFrame(JGamePlay jplay) |
|
TemplatePlayer.MoveEvaluater(TemplatePlayer.Synchronizer synch,
GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds,
Monitor monitor)
|
|
| Uses of GamePlay in com.antelmann.game.awari |
|---|
| Classes in com.antelmann.game.awari that implement GamePlay | |
|---|---|
class |
AwariGame
AwariGame implements an ancient African game (for all I know). |
| Methods in com.antelmann.game.awari with parameters of type GamePlay | |
|---|---|
boolean |
AwariPlayer.canPlayGame(GamePlay game)
|
double |
AwariPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
| Uses of GamePlay in com.antelmann.game.card |
|---|
| Classes in com.antelmann.game.card that implement GamePlay | |
|---|---|
class |
BlackJack
BlackJack implements the rules for playing BlackJack. |
| Methods in com.antelmann.game.card with parameters of type GamePlay | |
|---|---|
boolean |
BJPlayer.canPlayGame(GamePlay game)
|
double |
BJPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
double |
BJCheater.heuristic(GamePlay game,
GameMove move,
int[] role)
|
| Uses of GamePlay in com.antelmann.game.checkers |
|---|
| Classes in com.antelmann.game.checkers that implement GamePlay | |
|---|---|
class |
CheckersGame
an implementation of the game checkers. |
| Methods in com.antelmann.game.checkers with parameters of type GamePlay | |
|---|---|
boolean |
CheckersPlayer.canPlayGame(GamePlay game)
|
double |
CheckersPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
seems effective for the opening, but not sufficiently discriminating in the end game |
| Uses of GamePlay in com.antelmann.game.chess |
|---|
| Classes in com.antelmann.game.chess that implement GamePlay | |
|---|---|
class |
ChessGame
ChessGame provides all external functions needed to play chess. |
| Methods in com.antelmann.game.chess with parameters of type GamePlay | |
|---|---|
boolean |
ChessPlayer.canPlayGame(GamePlay game)
|
double |
ChessPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
this heuristic still needs some major work; it only looks at piece value at this point |
| Uses of GamePlay in com.antelmann.game.fourwins |
|---|
| Classes in com.antelmann.game.fourwins that implement GamePlay | |
|---|---|
class |
FourWinsGame
FourWinsGame represents the game of 4-wins or 4-connects. |
| Methods in com.antelmann.game.fourwins with parameters of type GamePlay | |
|---|---|
boolean |
FourWinsPlayer.canPlayGame(GamePlay game)
|
double |
FourWinsPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
GameMove |
FourWinsPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
|
| Uses of GamePlay in com.antelmann.game.gomoku |
|---|
| Classes in com.antelmann.game.gomoku that implement GamePlay | |
|---|---|
class |
GomokuGame
an implementation of the game Go-moku |
| Methods in com.antelmann.game.gomoku with parameters of type GamePlay | |
|---|---|
boolean |
GomokuPlayer.canPlayGame(GamePlay game)
|
double |
GomokuPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
boolean |
GomokuPlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
ignore all moves that are either at the edge or have no neighbor |
| Uses of GamePlay in com.antelmann.game.mine |
|---|
| Classes in com.antelmann.game.mine that implement GamePlay | |
|---|---|
class |
MineSweeper
An implementation of the game Mine Sweeper |
| Uses of GamePlay in com.antelmann.game.muehle |
|---|
| Classes in com.antelmann.game.muehle that implement GamePlay | |
|---|---|
class |
MuehleGame
a representation of the game of Muehle |
| Methods in com.antelmann.game.muehle with parameters of type GamePlay | |
|---|---|
boolean |
MuehlePlayer.canPlayGame(GamePlay game)
|
double |
MuehlePlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
boolean |
MuehlePlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
A move is pruned if capture moves are possible while this is not one of them (with the exception of when the opponent may only have 3 pieces left and may jump). |
| Uses of GamePlay in com.antelmann.game.puzzle |
|---|
| Classes in com.antelmann.game.puzzle that implement GamePlay | |
|---|---|
class |
EightQueens
EightQueens implements the problem of placing 8 queens on a chess board so that they don't attack each other. |
class |
Solitaire
A one-player game where the goal is to remove all 'peggs' on the board by jumping over them one by one. |
class |
TilePuzzle
implements a very flexible tile puzzle game with various options |
class |
WSPuzzle
WSPuzzle implements the 'Wolf & Sheep Puzzle'. |
| Methods in com.antelmann.game.puzzle that return GamePlay | |
|---|---|
static GamePlay |
WSPuzzle.searchSolution()
tries to solve the puzzle with GameUtilities functions |
static GamePlay |
EightQueens.searchSolution()
tries to solve the puzzle with GameUtilities functions |
| Methods in com.antelmann.game.puzzle with parameters of type GamePlay | |
|---|---|
boolean |
TilePuzzlePlayer.canPlayGame(GamePlay game)
|
double |
TilePuzzlePlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
| Constructors in com.antelmann.game.puzzle with parameters of type GamePlay | |
|---|---|
PuzzleNotSolvableException(GamePlay game,
String text)
|
|
| Uses of GamePlay in com.antelmann.game.reversi |
|---|
| Classes in com.antelmann.game.reversi that implement GamePlay | |
|---|---|
class |
ReversiGame
also known as Othello game |
| Methods in com.antelmann.game.reversi with parameters of type GamePlay | |
|---|---|
boolean |
ReversiPlayer.canPlayGame(GamePlay game)
|
double |
ReversiPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
this heuristic is basically counting pieces, but as long as the game is not over, it weights the pieces differently according to their potential for a final win. |
| Uses of GamePlay in com.antelmann.game.ttt |
|---|
| Classes in com.antelmann.game.ttt that implement GamePlay | |
|---|---|
class |
TickTackToe
This class implements the game TickTackToe. |
| Uses of GamePlay in com.antelmann.game.wolfsheep |
|---|
| Classes in com.antelmann.game.wolfsheep that implement GamePlay | |
|---|---|
class |
WolfsheepGame
an implementation of the wolf&sheep game which is played on a chess-like board; it uses the BoardPosition from the chess package for convenience. |
| Methods in com.antelmann.game.wolfsheep with parameters of type GamePlay | |
|---|---|
boolean |
WSPlayer.canPlayGame(GamePlay game)
|
double |
WSPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
only cares for the first given role in the role array |
GameMove |
WSPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
overridden to provide a sensible opening that doesn't suffer from the horizon effect |
|
|
|||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||