// // Analyse algorithm // model time, solve time, total time, model size // import java.util.*; import java.io.*; public class AnalyseAlgScatter { private static void scatter(String alg,int nlo,int nhi,int inc,int lwb,int upb) throws IOException { String fname = ""; String skip = ""; for (int n=nlo;n<=nhi;n=n+inc){ for (int i=lwb;i<=upb;i++){ if (i < 10) fname = "../randomResults/"+ alg +"-"+ n +"-0"+ i +".txt"; else fname = "../randomResults/"+ alg +"-"+ n +"-"+ i +".txt"; Scanner sc = new Scanner(new File(fname)); System.out.print(n); skip = sc.next(); // solutions: System.out.print(" "+ sc.nextInt()); skip = sc.next(); // nodes System.out.print(" "+ sc.nextInt()); skip = sc.next(); // model time System.out.print(" "+ sc.nextInt()); skip = sc.next(); // solve time System.out.print(" "+ sc.nextInt()); skip = sc.next(); // total time System.out.print(" "+ sc.nextInt()); skip = sc.next(); // model size System.out.print(" "+ sc.nextInt()); System.out.println(); sc.close(); } } } public static void main(String[] args) throws IOException { String alg = args[0]; int nlo = Integer.parseInt(args[1]); // number of agents int nhi = Integer.parseInt(args[2]); // number of agents int inc = Integer.parseInt(args[3]); int lwb = Integer.parseInt(args[4]); // index of 1st results file int upb = Integer.parseInt(args[5]); // index of last results file scatter(alg,nlo,nhi,inc,lwb,upb); } }