AnyGhostThreatModeSelector extends MsPacManModeSelector { @Override public int[] associatedFitnessScores() { int[] result = new int[numModes()]; result[SOME_GHOST_THREATENING] = GAME_SCORE; result[ALL_GHOSTS_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 there are some threatening * ghosts in the first index and the score for if there are no * threatening ghosts in the second index */ int[] associatedFitnessScores(); static final int ALL_GHOSTS_EDIBLE; static final int SOME_GHOST_THREATENING; }
@Test public void testAssociatedFitnessScores() { assertArrayEquals(new int[]{3,1}, select.associatedFitnessScores()); }