AnyPillsModeSelector extends MsPacManModeSelector { @Override public int[] associatedFitnessScores() { int[] result = new int[numModes()]; result[PILLS_PRESENT] = PILL_SCORE; result[NO_PILLS_PRESENT] = GHOST_SCORE; return result; } AnyPillsModeSelector(); 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 pills in the * first index and the score for if there are no pills in the second * index */ int[] associatedFitnessScores(); static final int PILLS_PRESENT; static final int NO_PILLS_PRESENT; }
@Test public void testAssociatedFitnessScores() { assertArrayEquals(new int[]{2,3}, select.associatedFitnessScores()); }