From 667711b1e6082e4c064a6ac2accc0c0107cf1cff Mon Sep 17 00:00:00 2001 From: aah13002 Date: Sat, 30 Apr 2016 17:43:36 -0400 Subject: [PATCH] Altered king heuristic to follow Samuel's paper, 2 kings equals 3 normal --- src/model/Board.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model/Board.java b/src/model/Board.java index ba0ea40..6aa14cb 100755 --- a/src/model/Board.java +++ b/src/model/Board.java @@ -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));