org.jscience.computing.game.chess
Class ChessPlayer

java.lang.Object
  extended by org.jscience.computing.game.TemplatePlayer
      extended by org.jscience.computing.game.chess.ChessPlayer
All Implemented Interfaces:
java.io.Serializable, Player

public class ChessPlayer
extends TemplatePlayer

provides AI for a ChessGame - unfortunately, it's still a dumb player

See Also:
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
ChessPlayer()
          Creates a new ChessPlayer object.
ChessPlayer(java.lang.String name)
          Creates a new ChessPlayer object.
ChessPlayer(java.lang.String name, int searchOption, boolean enableTracking)
          Creates a new ChessPlayer object.
ChessPlayer(java.lang.String name, int searchOption, boolean enableTracking, long randomSeed)
          Creates a new ChessPlayer object.
 
Method Summary
 boolean canPlayGame(GamePlay game)
          DOCUMENT ME!
 int getPieceValue(org.jscience.computing.game.chess.ChessPiece piece)
          DOCUMENT ME!
 double heuristic(GamePlay game, GameMove move, int[] role)
          this heuristic still needs some major work; it only looks at piece value at this point
 void setRandomSeed(long seed)
          if seed = 0, randomization is disabled
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.computing.game.TemplatePlayer
disableTracking, enableTracking, evaluate, evaluate, getLevelOverwrite, getMonitors, getOrderMoves, getPlayerName, getSearchOption, numberOfPositionsSearched, numberOfRequests, performanceRatio, pruneMove, selectMove, setLevelOverwrite, 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

ChessPlayer

public ChessPlayer()
Creates a new ChessPlayer object.


ChessPlayer

public ChessPlayer(java.lang.String name)
Creates a new ChessPlayer object.

Parameters:
name - DOCUMENT ME!

ChessPlayer

public ChessPlayer(java.lang.String name,
                   int searchOption,
                   boolean enableTracking)
Creates a new ChessPlayer object.

Parameters:
name - DOCUMENT ME!
searchOption - DOCUMENT ME!
enableTracking - DOCUMENT ME!

ChessPlayer

public ChessPlayer(java.lang.String name,
                   int searchOption,
                   boolean enableTracking,
                   long randomSeed)
Creates a new ChessPlayer object.

Parameters:
name - DOCUMENT ME!
searchOption - DOCUMENT ME!
enableTracking - DOCUMENT ME!
randomSeed - DOCUMENT ME!
Method Detail

canPlayGame

public boolean canPlayGame(GamePlay game)
DOCUMENT ME!

Parameters:
game - DOCUMENT ME!
Returns:
DOCUMENT ME!

setRandomSeed

public void setRandomSeed(long seed)
if seed = 0, randomization is disabled

Parameters:
seed - DOCUMENT ME!

heuristic

public double heuristic(GamePlay game,
                        GameMove move,
                        int[] role)
this heuristic still needs some major work; it only looks at piece value at this point

Parameters:
game - DOCUMENT ME!
move - DOCUMENT ME!
role - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
TemplatePlayer

getPieceValue

public int getPieceValue(org.jscience.computing.game.chess.ChessPiece piece)
DOCUMENT ME!

Parameters:
piece - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.Error - DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class TemplatePlayer
Returns:
DOCUMENT ME!