|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.game.TemplatePlayer
org.jscience.computing.game.wolfsheep.WSPlayer
public class WSPlayer
WSPlayer adds AI to the WolfsheepGame; can play both, wolf and sheep. Note: It seems that for the sheeps to win, the game level needs to be set to 7 or higher. If the sheeps move with sufficient intelligence, they cannot loose; the wolf can only win based on mistakes of the sheeps. Also, if the level is set high, the wolf tends to play too defensively (as it anticipates the right move from the sheep that won't let it get through, anyway), so if you want to play against the wolf, set the level lower to make it play more dangerous.
WolfsheepGame,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jscience.computing.game.TemplatePlayer |
|---|
TemplatePlayer.MoveEvaluater, TemplatePlayer.Synchronizer |
| Field Summary |
|---|
| Fields inherited from class org.jscience.computing.game.TemplatePlayer |
|---|
levelOverwrite, monitors, orderMoves, playerName, SEARCH_ALPHABETA, SEARCH_MINMAX, searchOption |
| Constructor Summary | |
|---|---|
WSPlayer()
Creates a new WSPlayer object. |
|
WSPlayer(java.lang.String name)
Creates a new WSPlayer object. |
|
| Method Summary | |
|---|---|
boolean |
canPlayGame(GamePlay game)
DOCUMENT ME! |
double |
heuristic(GamePlay game,
GameMove move,
int[] role)
only cares for the first given role in the role array |
GameMove |
selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
overwritten to provide a sensible opening that doesn't suffer from the horizon effect |
void |
setRandomSeed(long seed)
if seed = 0, randomization is disabled |
protected double |
sheepHeuristic(WolfsheepGame game,
int[] role)
DOCUMENT ME! |
protected double |
wolfHeuristic(WolfsheepGame game,
int[] role)
DOCUMENT ME! |
| Methods inherited from class org.jscience.computing.game.TemplatePlayer |
|---|
disableTracking, enableTracking, evaluate, evaluate, getLevelOverwrite, getMonitors, getOrderMoves, getPlayerName, getSearchOption, numberOfPositionsSearched, numberOfRequests, performanceRatio, pruneMove, setLevelOverwrite, setOrderMoves, setPlayerName, setSearchOption, setTracking, statsAsString, toString, totalTimeTaken, trackingEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WSPlayer()
public WSPlayer(java.lang.String name)
name - DOCUMENT ME!| Method Detail |
|---|
public boolean canPlayGame(GamePlay game)
game - DOCUMENT ME!
public void setRandomSeed(long seed)
seed - DOCUMENT ME!
public GameMove selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
selectMove in interface PlayerselectMove in class TemplatePlayergame - DOCUMENT ME!role - DOCUMENT ME!level - DOCUMENT ME!milliseconds - DOCUMENT ME!
TemplatePlayer.Synchronizer,
TemplatePlayer.MoveEvaluater
public double heuristic(GamePlay game,
GameMove move,
int[] role)
game - DOCUMENT ME!move - DOCUMENT ME!role - DOCUMENT ME!
java.lang.Error - DOCUMENT ME!TemplatePlayer
protected double wolfHeuristic(WolfsheepGame game,
int[] role)
game - DOCUMENT ME!role - DOCUMENT ME!
protected double sheepHeuristic(WolfsheepGame game,
int[] role)
game - DOCUMENT ME!role - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||