ClosestGhostModeSelector extends MsPacManModeSelector { @Override public int[] associatedFitnessScores() { int[] result = new int[numModes()]; result[CLOSEST_THREAT] = GAME_SCORE; result[CLOSEST_EDIBLE] = GHOST_SCORE; return result; }  int mode(); int numModes(); @Override /** * gets the associated fitness scores with this mode selector * * @return an int array holding the score for if the closest ghost is a * threat in the first index and the score for if the closest ghost * is edible in the second index */ int[] associatedFitnessScores(); static final int CLOSEST_THREAT; static final int CLOSEST_EDIBLE; }
@Test public void testAssociatedFitnessScores() { assertArrayEquals(new int[]{1,3}, select.associatedFitnessScores()); }