DangerousAreaModeSelector extends MsPacManModeSelector { public static void updateScentMaps() { if (scentMaps != null) { scentMaps = Executor.deaths.deathCount(); mazeAverages = new double[Constants.NUM_MAZES]; for (int i = 0; i < mazeAverages.length; i++) { if (scentMaps.containsKey(i)) { HashMap<Integer, Integer> mazeDeaths = scentMaps.get(i); double[] counts = ArrayUtil .doubleArrayFromList(Collections.list(Collections.enumeration(mazeDeaths.values()))); mazeAverages[i] = StatisticsUtilities.average(counts); } } System.out.println("Updating scent maps from file: " + Arrays.toString(mazeAverages)); } } DangerousAreaModeSelector(); static void updateScentMaps(); int mode(); int numModes(); @Override /** * gets the associated fitness scores with this mode selector based on the * danger of this area * * @return an int array holding the score for if the area is dangerous in * the first index and the score for if the area is safe in the * second index */ int[] associatedFitnessScores(); static HashMap<Integer, HashMap<Integer, Integer>> scentMaps; static double[] mazeAverages; static final int DANGEROUS; static final int SAFE; }
@Test public void testUpdateScentMaps() { fail("Not yet implemented"); }