xHashMap.put(index + "", line);
index++;
}
DataPreProcessor dpp = new DataPreProcessor(vtmp);
dpp.run();
Messager msger = new Messager();
Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
if (entries.size() <= 1)
return Double.MAX_VALUE;
ExampleSelection expsel = new ExampleSelection();
ExampleSelection.firsttime = true;
expsel.inite(xHashMap, null);
int target = Integer.parseInt(expsel.Choose());
String[] mt = { "<_START>" + entries.get(target)[0] + "<_END>",
entries.get(target)[1] };
examples.add(mt);
ExampleSelection.firsttime = false;
// accuracy record code
ArrayList<double[]> accArrayList = new ArrayList<double[]>();
long stime = System.currentTimeMillis();
boolean overtime = true;
while (true) // repeat as no incorrect answer appears.
{
if (examples.size() == 4) {
System.out.println("Hello World");
}
if (System.currentTimeMillis() - stime > 600000) {
overtime = false;
break;
}
long checknumber = 1;
long iterAfterNoFatalError = 0;
long isvisible = 0;
HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
Vector<String> resultString = new Vector<String>();
xHashMap = new HashMap<String, String[]>();
ProgSynthesis psProgSynthesis = new ProgSynthesis();
HashMap<String, String> unlabeledData = new HashMap<String, String>();
for (int i = 0; i < vtmp.size(); i++) {
unlabeledData.put("" + i, vtmp.get(i));
}
psProgSynthesis.inite(examples, dpp, msger);
Vector<ProgramRule> pls = new Vector<ProgramRule>();
Collection<ProgramRule> ps = psProgSynthesis.run_main();
// collect history contraints
msger.updateCM_Constr(psProgSynthesis.partiCluster
.getConstraints());
msger.updateWeights(psProgSynthesis.partiCluster.weights);
// constraints.addAll();
if (ps != null) {
pls.addAll(ps);
} else {
System.out.println("Cannot find any rule");