### Question:
GaussianProcessPrior extends WeightLearningApplication { protected List<WeightConfig> getConfigs() { int numMutableRules = this.mutableRules.size(); List<WeightConfig> configs = new ArrayList<WeightConfig>(); float max = 1.0f; float min = 1.0f / MAX_RAND_INT_VAL; if (space == GaussianProcessKernel.Space.OS) { min = 0.0f; } int numPerSplit = (int)Math.exp(Math.log(maxConfigs) / numMutableRules); if (randomConfigsOnly) { log.debug("Generating random configs."); return getRandomConfigs(); } if (numPerSplit < 5) { log.warn("Note not picking random points and large number of rules will yield bad exploration."); } float inc = max / numPerSplit; float[] configArray = new float[numMutableRules]; Arrays.fill(configArray, min); WeightConfig config = new WeightConfig(configArray); boolean done = false; while (!done) { int i = 0; configs.add(new WeightConfig(config)); for (int j = 0; j < numMutableRules; j++) { if (config.config[i] < max) { config.config[i] += inc; break; } if (i == numMutableRules - 1) { done = true; break; } config.config[i] = min; i++; } } return configs; } GaussianProcessPrior(List<Rule> rules, Database rvDB, Database observedDB);  GaussianProcessPrior(Model model, Database rvDB, Database observedDB);  static final String CONFIG_PREFIX; static final String KERNEL_KEY; static final String KERNEL_DEFAULT; static final String MAX_ITERATIONS_KEY; static final int MAX_ITERATIONS_DEFAULT; static final String MAX_CONFIGS_KEY; static final int MAX_CONFIGS_DEFAULT; static final String EXPLORATION_KEY; static final float EXPLORATION_DEFAULT; static final String RANDOM_CONFIGS_ONLY_KEY; static final boolean RANDOM_CONFIGS_ONLY_DEFAULT; static final String EARLY_STOPPING_KEY; static final boolean EARLY_STOPPING_DEFAULT; static final int MAX_RAND_INT_VAL; static final float SMALL_VALUE; }### Answer:
@Test public void testGetConfigs() { Config.setProperty(GaussianProcessPrior.MAX_CONFIGS_KEY, 5); Config.setProperty(GaussianProcessPrior.RANDOM_CONFIGS_ONLY_KEY, false); GaussianProcessPrior wl = (GaussianProcessPrior)getWLA(); List<GaussianProcessPrior.WeightConfig> configs = wl.getConfigs(); List<float[]> expected = new ArrayList<float[]>(); expected.add(new float[]{0.0f, 0.0f, 0.0f}); expected.add(new float[]{1.0f, 0.0f, 0.0f}); expected.add(new float[]{0.0f, 1.0f, 0.0f}); expected.add(new float[]{1.0f, 1.0f, 0.0f}); expected.add(new float[]{0.0f, 0.0f, 1.0f}); expected.add(new float[]{1.0f, 0.0f, 1.0f}); expected.add(new float[]{0.0f, 1.0f, 1.0f}); expected.add(new float[]{1.0f, 1.0f, 1.0f}); for (int i = 0; i < configs.size(); i++) { for (int j = 0; j < configs.get(i).config.length; j++) { Assert.assertEquals(expected.get(i)[j], configs.get(i).config[j], 1e-5); } } }