|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.game.TemplatePlayer
com.antelmann.game.muehle.MuehlePlayer
public class MuehlePlayer
adds AI to the MuehleGame and provides a suitable heuristic to evaluate the game
MuehleGame,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.antelmann.game.TemplatePlayer |
|---|
TemplatePlayer.MoveEvaluater, TemplatePlayer.Synchronizer |
| Field Summary |
|---|
| Fields inherited from class com.antelmann.game.TemplatePlayer |
|---|
levelOverride, monitors, orderMoves, playerName, SEARCH_ALPHABETA, SEARCH_MINMAX, searchOption |
| Constructor Summary | |
|---|---|
MuehlePlayer()
|
|
MuehlePlayer(String name)
|
|
MuehlePlayer(String name,
int searchOption,
boolean trackingEnabled)
|
|
MuehlePlayer(String name,
int searchOption,
boolean trackingEnabled,
long randomSeed)
|
|
| Method Summary | |
|---|---|
boolean |
canPlayGame(GamePlay game)
canPlayGame() returns true only if the Player provides an applicable heuristic for the type of game given. |
double |
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. |
boolean |
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). |
void |
setRandomSeed(long seed)
if seed = 0, randomization is disabled |
String |
toString()
overridden to return some information about the player |
| Methods inherited from class com.antelmann.game.TemplatePlayer |
|---|
disableTracking, enableTracking, evaluate, evaluate, getlevelOverride, getMonitors, getOrderMoves, getPlayerName, getSearchOption, numberOfPositionsSearched, numberOfRequests, performanceRatio, selectMove, setlevelOverride, setOrderMoves, setPlayerName, setSearchOption, setTracking, statsAsString, totalTimeTaken, trackingEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MuehlePlayer()
public MuehlePlayer(String name)
public MuehlePlayer(String name,
int searchOption,
boolean trackingEnabled)
public MuehlePlayer(String name,
int searchOption,
boolean trackingEnabled,
long randomSeed)
| Method Detail |
|---|
public boolean canPlayGame(GamePlay game)
Player
//Example:
if (game instanceof MyGameClass) return true; else return false;
// or:
if (game.getClass() == myFavoriteGame.getClass()) return true; else return false;
public boolean pruneMove(GamePlay game,
GameMove move,
int[] role)
pruneMove in interface PlayerpruneMove in class TemplatePlayerpublic void setRandomSeed(long seed)
public double heuristic(GamePlay game,
GameMove move,
int[] role)
Player
TemplatePlayerpublic String toString()
TemplatePlayer
toString in class TemplatePlayer
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||