Package org.swtpra1.alphabetaplayer
Class RelativeTerritoryEvaluator
- java.lang.Object
-
- org.swtpra1.alphabetaplayer.RelativeTerritoryEvaluator
-
-
Constructor Summary
Constructors Constructor Description RelativeTerritoryEvaluator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int[][]
copy2dArray(int[][] array)
Copy a 2-dimensional array because Arrays.copyOf doesn't work with 2d arrays.float
evaluate(Board board, int playerId)
board value from perspective of player with given id.int
getBoardValue(int[][] squares, int playerId)
Calculate the value of a board based on relative territory heuristic.
-
-
-
Method Detail
-
evaluate
public float evaluate(Board board, int playerId)
board value from perspective of player with given id.
-
getBoardValue
public int getBoardValue(int[][] squares, int playerId)
Calculate the value of a board based on relative territory heuristic.- Parameters:
squares
- the 'real' playboard- Returns:
- value of board = number of squares i reach faster - number of squares my enemy reaches faster
-
copy2dArray
public static int[][] copy2dArray(int[][] array)
Copy a 2-dimensional array because Arrays.copyOf doesn't work with 2d arrays.- Parameters:
array
- array to be copied- Returns:
- copied array
-
-