CompleteTaskModeSelector extends MsPacManModeSelector { @Override public int[] associatedFitnessScores() { int[] result = new int[numModes()]; result[EAT_GHOSTS] = IMPROPER_POWER_PILL_GHOST_COMBO; result[LURE] = LURING_FITNESS; result[EAT_PILLS] = PILL_AND_NO_POWER_PILL_COMBO; return result; } CompleteTaskModeSelector(); int mode(); int numModes(); @Override /** * gets the associated fitness scores with this mode selector based on human * defined close ghost distance * * @return an int array holding the score for if the ghosts are edible in * the first index, the score for if there are no edible ghosts and * a ghost is near in the second index, and the score for if there * are no edible ghosts and the ghosts are not near in the third * index */ int[] associatedFitnessScores(); static final int EAT_GHOSTS; static final int LURE; static final int EAT_PILLS; final int closeGhostDistance; }
@Test public void testAssociatedFitnessScores() { assertArrayEquals(new int[]{13,14,19}, select.associatedFitnessScores()); }