ai.alphabeta
Interface NodeModel

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
BoardState

public interface NodeModel
extends java.io.Serializable, java.lang.Cloneable

The NodeModel is used by the AlphaBeta.

Version:
$Revision: 1.0.1, 2003-09-02 $
Author:
Peter Larsson

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean gameOver()
          Checks whether the game is over or not
 java.util.Vector getAllMoves(int player)
          Will return all possible moves for the player
 int[][] getBoard()
          Will return the board
 int[][] move(int row, int col)
          Makes a valid move in the board and returns the new board.
 void retractState(int[][] board, int player)
          Retracts a move for the board.
 int value(int player, int depth)
          Will return the calculated value for a certain state
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Method Detail

getBoard

public int[][] getBoard()
Will return the board
Returns:
The board is represented as a matrix of int

getAllMoves

public java.util.Vector getAllMoves(int player)
Will return all possible moves for the player
Parameters:
player - Viewpoint from player int
Returns:
A Vector with all possible moves

value

public int value(int player,
                 int depth)
Will return the calculated value for a certain state
Parameters:
player - The player is represented as an int
depth - The depth is represented as an int
Returns:
Returns the calculated value of the state

move

public int[][] move(int row,
                    int col)

Makes a valid move in the board and returns the new board.

Parameters:
move - The move represented as a String
Returns:
int Returns the new representation of the board

retractState

public void retractState(int[][] board,
                         int player)

Retracts a move for the board.

Parameters:
board - The board is represented as a matrix of int
player - The player is represented as an int

gameOver

public boolean gameOver()
Checks whether the game is over or not
Returns:
Returns true if it is GAME OVER, otherwise false