package stat; import java.awt.*; import java.io.*; import parameters.Parameter; import parameters.ParameterSet; import parameters.ParameterSetArray; /** A way of getting a list of the parameter sets which did or didn't pass some test. The output file has a 1 for each parameter set that passed, and a 0 for each one that didn't pass. By running different tests on the same list of parameters and then running this stat on each output file, you can create an array of which parameter sets in the original list did or didn't pass each of the tests. */ public class DumpSuccessArrayStat extends Stat { public DumpSuccessArrayStat() {} public void calculateStat() { int i; if(paramSets == null) { System.out.println("No Cam loaded - DumpSuccessArrayStat did nothing"); return; } try { makeOutputFile(); prototype = paramSets.getPrototype(); if(prototype == null) { prototype = paramSets.goToBeginning(); } if(prototype == null) { closeOutputFile(); return; // Nothing in cam file } ParameterSet set = paramSets.goToBeginning(); int last_set_num = 0; while(set != null) { while(set.getGroupNum() > last_set_num) { printlnToFile("0"); last_set_num++; } printlnToFile("1"); set = paramSets.getNextSet(); last_set_num++; } closeOutputFile(); System.out.println("Dumped"); } catch(Exception e) { System.out.println("Error in AveragesStat: " + e.toString()); } } }