No Description
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.

DebuggingMain.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package jobshop;
  2. import jobshop.encodings.JobNumbers;
  3. import jobshop.encodings.Schedule;
  4. import jobshop.solvers.GreedySolver;
  5. import java.io.IOException;
  6. import java.nio.file.Paths;
  7. public class DebuggingMain {
  8. public static void main(String[] args) {
  9. try {
  10. // load the aaa1 instance
  11. Instance instance = Instance.fromFile(Paths.get("instances/aaa1"));
  12. // builds a solution in the job-numbers encoding [0 1 1 0 0 1]
  13. JobNumbers enc = new JobNumbers(instance);
  14. enc.addTask(0);
  15. enc.addTask(1);
  16. enc.addTask(1);
  17. enc.addTask(0);
  18. enc.addTask(0);
  19. enc.addTask(1);
  20. System.out.println("\nENCODING: " + enc);
  21. Schedule schedule = enc.toSchedule();
  22. System.out.println("VALID: " + schedule.isValid());
  23. System.out.println("MAKESPAN: " + schedule.makespan());
  24. System.out.println("SCHEDULE: " + schedule.toString());
  25. System.out.println("GANTT: " + schedule.asciiGantt());
  26. } catch (IOException e) {
  27. e.printStackTrace();
  28. System.exit(1);
  29. }
  30. }
  31. }