System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
SolverMulti solver = new SolverMultiClosedChow(classes, stations, pop);
String algorithm = "Chow";
if (solver.input(name, type, servt, visits)) {
long start = System.currentTimeMillis();
solver.solve();
System.out.println(algorithm);
System.out.println(solver);
System.out.print(algorithm+",");
//System.out.println(algorithm);
//System.out.println("-------------------------------------");
//System.out.println(queueLength(stations, classes, solver));
long stop = System.currentTimeMillis();
System.out.print(((stop-start)/(double)1000) + ",");
//System.out.println("Elapsed time (ms) = " + (stop - start));
start = 0; stop = 0;
long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
solver = null;
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.print(((mem0-mem1)/(double)1024) + ",");
System.out.print((mem0/(double)1024) + "\n");
// System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
// System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
// System.out.println("-------------------------------------");
mem0 = 0; mem1 = 0;
} else {
System.out.println("Wrong input!!");
}
solver = new SolverMultiClosedBardSchweitzer(classes, stations, pop);
algorithm = "Bard-Schweitzer";
if (solver.input(name, type, servt, visits)) {
long start = System.currentTimeMillis();
solver.solve();
System.out.println(algorithm);
System.out.println(solver);
System.out.print(algorithm+",");
//System.out.println(algorithm);
//System.out.println("-------------------------------------");
//System.out.println(queueLength(stations, classes, solver));
long stop = System.currentTimeMillis();
System.out.print(((stop-start)/(double)1000) + ",");
//System.out.println("Elapsed time (ms) = " + (stop - start));
start = 0; stop = 0;
long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
solver = null;
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.print(((mem0-mem1)/(double)1024) + ",");
System.out.print((mem0/(double)1024) + "\n");
// System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
// System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
// System.out.println("-------------------------------------");
mem0 = 0; mem1 = 0;
} else {
System.out.println("Wrong input!!");
}
solver = new SolverMultiClosedAQL(classes, stations, pop);
algorithm = "AQL";
if (solver.input(name, type, servt, visits)) {
long start = System.currentTimeMillis();
solver.solve();
System.out.println(algorithm);
System.out.println(solver);
System.out.print(algorithm+",");
//System.out.println(algorithm);
//System.out.println("-------------------------------------");
//System.out.println(queueLength(stations, classes, solver));
long stop = System.currentTimeMillis();
System.out.print(((stop-start)/(double)1000) + ",");
//System.out.println("Elapsed time (ms) = " + (stop - start));
start = 0; stop = 0;
long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
solver = null;
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.print(((mem0-mem1)/(double)1024) + ",");
System.out.print((mem0/(double)1024) + "\n");
// System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
// System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
// System.out.println("-------------------------------------");
mem0 = 0; mem1 = 0;
} else {
System.out.println("Wrong input!!");
}
solver = new SolverMultiClosedLinearizer(classes, stations, pop, false);
algorithm = "Linearizer";
if (solver.input(name, type, servt, visits)) {
long start = System.currentTimeMillis();
solver.solve();
System.out.println(algorithm);
System.out.println(solver);
System.out.print(algorithm+",");
//System.out.println(algorithm);
//System.out.println("-------------------------------------");
//System.out.println(queueLength(stations, classes, solver));
long stop = System.currentTimeMillis();
System.out.print(((stop-start)/(double)1000) + ",");
//System.out.println("Elapsed time (ms) = " + (stop - start));
start = 0; stop = 0;
long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
solver = null;
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
System.gc(); System.gc(); System.gc(); System.gc();
long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.print(((mem0-mem1)/(double)1024) + ",");
System.out.print((mem0/(double)1024) + "\n");
// System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
// System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
// System.out.println("-------------------------------------");
mem0 = 0; mem1 = 0;
} else {
System.out.println("Wrong input!!");
}
solver = new SolverMultiClosedLinearizer(classes, stations, pop, true);
algorithm = "DeSouza-Muntz Linearizer";
if (solver.input(name, type, servt, visits)) {
long start = System.currentTimeMillis();
solver.solve();
System.out.println(algorithm);
System.out.println(solver);
System.out.print(algorithm+",");
//System.out.println(algorithm);