private void throwNotEnoughSubmissions() throws jplag.ExitException { StringBuilder errorStr = new StringBuilder(); for (String str : errorVector) { errorStr.append(str); errorStr.append('\n'); } throw new ExitException("Not enough valid submissions! (only " + validSubmissions() + " " + (validSubmissions() != 1 ? "are" : "is") + " valid):\n" + errorStr.toString(), ExitException.NOT_ENOUGH_SUBMISSIONS_ERROR); }
private void expCompare() throws jplag.ExitException { int size = validSubmissions(); int[] similarity = new int[(size * size - size) / 2]; int anzSub = submissions.size(); int i, j, count = 0; Submission s1, s2; AllMatches match; long msec = System.currentTimeMillis(); for (i = 0; i < (anzSub - 1); i++) { s1 = submissions.elementAt(i); if (s1.struct == null) continue; for (j = (i + 1); j < anzSub; j++) { s2 = submissions.elementAt(j); if (s2.struct == null) continue; match = this.gSTiling.compare(s1, s2); similarity[count++] = (int) match.percent(); } } long time = System.currentTimeMillis() - msec; // output System.out.print(options.root_dir + " "); System.out.print(options.min_token_match + " "); System.out.print(options.filtername + " "); System.out.print((time) + " "); for (i = 0; i < similarity.length; i++) System.out.print(similarity[i] + " "); System.out.println(); }
print("Skipping parsing...\n", null); if (validSubmissions() < 2) { throwNotEnoughSubmissions();
int matchIndex = 0; print("Comparing: ", validSubmissions() + " submissions"); print("\n(Writing results at the same time.)\n", null);
+ (program.get_sub_dir() != null ? File.separator + "*" + File.separator + program.get_sub_dir() : "")); f.println("language" + "\t" + language.name()); f.println("submissions" + "\t" + program.validSubmissions()); f.println("errors" + "\t" + program.getErrors()); f.close();
+ "</TD></TR>"); f.print("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + msg.getString("Report.Submissions") + ":</TD><TD>" + this.program.validSubmissions()); if (program.getErrors() != 0) { if (this.program.getErrors() == 1)