Skip to content

Commit

Permalink
Altered king heuristic to follow Samuel's paper, 2 kings equals 3 normal
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron committed Apr 30, 2016
1 parent 8daef5b commit 667711b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/model/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ public boolean isPromotionLocation(Location location) {
location.row == BOARD_SIZE - 1 );
}

public int getHeuristic(Color color) {
public double getHeuristic(Color color) {
/* Kings are weighted more, so we count for them twice */
int blackHeuristic = blackPieces + blackKings;
int whiteHeuristic = whitePieces + whiteKings;
double blackHeuristic = blackPieces + blackKings * 1.5;
double whiteHeuristic = whitePieces + whiteKings * 1.5;
return - (color == Color.BLACK ?
(blackHeuristic - whiteHeuristic) :
(whiteHeuristic - blackHeuristic));
Expand Down

0 comments on commit 667711b

Please sign in to comment.