ai
Class OptimizingAlphaBetaPlayer

java.lang.Object
  extended by core.Player
      extended by ai.OptimizingAlphaBetaPlayer
All Implemented Interfaces:
Runnable, net.antichess.ai.AiPlayer

public class OptimizingAlphaBetaPlayer
extends Player
implements Runnable

An ai player that uses alpha-beta pruning for some heuristic.

Specification Fields :
state : game state // the current state of the came according to the ai

Constructor Summary
OptimizingAlphaBetaPlayer(Color c, Heuristic h)
          Creates a new OptimizingAlphaBetaPlayer player of the given color
OptimizingAlphaBetaPlayer(Color c, Heuristic h, int num_threads, PrintStream output, Map<Position,Piece> powerupDiffs)
          Creates a new OptimizingAlphaBetaPlayer player of the given color
 
Method Summary
 Move askForMove(Move opponentsMove)
          Gets the next move of the player, given the opponents move.
 Move askForMove(Move opponentsMove, long myTime, long opponentsTime)
           
 void run()
          Start a new threadSearch on the current state.
 void update(Game game)
          Has the player make a series of moves.
 
Methods inherited from class core.Player
getColor, getMove, getPersistentState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimizingAlphaBetaPlayer

public OptimizingAlphaBetaPlayer(Color c,
                                 Heuristic h)
Creates a new OptimizingAlphaBetaPlayer player of the given color

Parameters:
c - color of the player
h - Static evaluator to use.
Requires:
c not null, h not null

OptimizingAlphaBetaPlayer

public OptimizingAlphaBetaPlayer(Color c,
                                 Heuristic h,
                                 int num_threads,
                                 PrintStream output,
                                 Map<Position,Piece> powerupDiffs)
Creates a new OptimizingAlphaBetaPlayer player of the given color

Parameters:
c - color of the player
h - Static evaluator to use.
num_threads - Maximum number of threads to use at a time
output - Place to spew debugging output.
powerupDiffs - Positions of powerups.
Requires:
c not null, h not null, output not null, num_threads >= 1
Method Detail

askForMove

public Move askForMove(Move opponentsMove)
Description copied from class: Player
Gets the next move of the player, given the opponents move.

Specified by:
askForMove in class Player
Parameters:
opponentsMove - the opponents move
See Also:
Player

askForMove

public Move askForMove(Move opponentsMove,
                       long myTime,
                       long opponentsTime)
Overrides:
askForMove in class Player
See Also:
Player

run

public void run()
Start a new threadSearch on the current state.

Specified by:
run in interface Runnable

update

public void update(Game game)
Has the player make a series of moves. Used to get the AI player up to speed on a newly loaded game

Specified by:
update in class Player
Parameters:
game - the new game
Requires:
game not null
Modifies:
state