University stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Main.java 704B

123456789101112131415161718192021222324252627282930313233
  1. class Main {
  2. public static void main(String[] args) {
  3. if (args.length != 1) {
  4. System.out.println("Usage: java Main <n>");
  5. System.exit(1);
  6. }
  7. NPunkter17 points = new NPunkter17(Integer.parseInt(args[0]));
  8. Oblig4 seq = new Sequential(points);
  9. Oblig4 par = new Parallel(points);
  10. Timer tseq = run(seq, null);
  11. run(par, tseq);
  12. seq.draw();
  13. }
  14. static Timer run(Oblig4 o, Timer base) {
  15. System.out.println(o.name+": filling...");
  16. o.fill();
  17. System.out.println("Done.");
  18. Timer t = new Timer().start();
  19. o.solve();
  20. t.end();
  21. if (base == null)
  22. System.out.println(o.name+": "+t.prettyTime());
  23. else
  24. System.out.println(o.name+": "+t.prettySpeedup(base));
  25. return t;
  26. }
  27. }