|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.Player
ai.OptimizingAlphaBetaPlayer
public class OptimizingAlphaBetaPlayer
An ai player that uses alpha-beta pruning for some heuristic.
state
: game state // the current state of the came according to
the aiConstructor 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 |
---|
public OptimizingAlphaBetaPlayer(Color c, Heuristic h)
c
- color of the playerh
- Static evaluator to use.public OptimizingAlphaBetaPlayer(Color c, Heuristic h, int num_threads, PrintStream output, Map<Position,Piece> powerupDiffs)
c
- color of the playerh
- Static evaluator to use.num_threads
- Maximum number of threads to use at a timeoutput
- Place to spew debugging output.powerupDiffs
- Positions of powerups.Method Detail |
---|
public Move askForMove(Move opponentsMove)
Player
askForMove
in class Player
opponentsMove
- the opponents movePlayer
public Move askForMove(Move opponentsMove, long myTime, long opponentsTime)
askForMove
in class Player
Player
public void run()
run
in interface Runnable
public void update(Game game)
update
in class Player
game
- the new game
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |