org.jscience.computing.game.gomoku
Class GomokuPlayer

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

public class GomokuPlayer
extends TemplatePlayer

adds AI to the GomokuGame

See Also:
GomokuGame, 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
GomokuPlayer()
          Creates a new GomokuPlayer object.
GomokuPlayer(java.lang.String name)
          Creates a new GomokuPlayer object.
 
Method Summary
 boolean canPlayGame(GamePlay game)
          DOCUMENT ME!
 double heuristic(GamePlay game, GameMove move, int[] role)
          DOCUMENT ME!
 boolean pruneMove(GamePlay game, GameMove move, int[] role)
          ignore all moves that are either at the edge or have no neighbor
protected  double ratePosition(GomokuGame game, int column, int row, int player)
          not done quite right, yet
 void setRandomSeed(long seed)
          if seed = 0, randomization is disabled
 
Methods inherited from class org.jscience.computing.game.TemplatePlayer
disableTracking, enableTracking, evaluate, evaluate, getLevelOverwrite, getMonitors, getOrderMoves, getPlayerName, getSearchOption, numberOfPositionsSearched, numberOfRequests, performanceRatio, selectMove, 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

GomokuPlayer

public GomokuPlayer()
Creates a new GomokuPlayer object.


GomokuPlayer

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

Parameters:
name - DOCUMENT ME!
Method Detail

canPlayGame

public boolean canPlayGame(GamePlay game)
DOCUMENT ME!

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

pruneMove

public boolean pruneMove(GamePlay game,
                         GameMove move,
                         int[] role)
ignore all moves that are either at the edge or have no neighbor

Specified by:
pruneMove in interface Player
Overrides:
pruneMove in class TemplatePlayer
Parameters:
game - DOCUMENT ME!
move - DOCUMENT ME!
role - DOCUMENT ME!
Returns:
DOCUMENT ME!

heuristic

public double heuristic(GamePlay game,
                        GameMove move,
                        int[] role)
DOCUMENT ME!

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

ratePosition

protected double ratePosition(GomokuGame game,
                              int column,
                              int row,
                              int player)
not done quite right, yet

Parameters:
game - DOCUMENT ME!
column - DOCUMENT ME!
row - DOCUMENT ME!
player - DOCUMENT ME!
Returns:
DOCUMENT ME!

setRandomSeed

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

Parameters:
seed - DOCUMENT ME!