diff --git a/src/CheckersGameState3.java b/src/CheckersGameState3.java index 01fa2f7..8b5ab63 100644 --- a/src/CheckersGameState3.java +++ b/src/CheckersGameState3.java @@ -430,6 +430,50 @@ public class CheckersGameState3 implements CheckersGameState{ features[11] = numOnDiag1(player) + numOnDiag2(player); return features; } + + /* computes feature vector: + [0: piece-ratio, + 1: # of moveable pawns + 2*#of moveable kings + 2: num attacking pieces + 3: central pieces + 4: # pawns on diagonal + 2 * # kings on diagonal + 5: ^ same but for the two smaller diagonals + ] + */ + public double[] getEndGameFeatures(int player){ + double[] features = new double[6]; + double total = 0.0; + double mypieces = 0.0; + for(int i = 0; i