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.

Result.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package jobshop;
  2. import jobshop.encodings.Schedule;
  3. import java.util.Optional;
  4. /** Class representing the result of a solver. */
  5. public class Result {
  6. /** Instance that was solved. */
  7. public final Instance instance;
  8. /** A schedule of the solution or Optional.empty() if no solution was found. */
  9. public final Optional<Schedule> schedule;
  10. /** Reason why the solver exited with this solution. */
  11. public final ExitCause cause;
  12. private int voisinsVisites;
  13. /** Creates a new Result object with the corresponding fields. */
  14. public Result(Instance instance, Optional<Schedule> schedule, ExitCause cause) {
  15. this.instance = instance;
  16. this.schedule = schedule;
  17. this.cause = cause;
  18. this.voisinsVisites = 0;
  19. }
  20. public int getVoisinsVisites() {
  21. return voisinsVisites;
  22. }
  23. public void setVoisinsVisites(int voisinsVisites) {
  24. this.voisinsVisites = voisinsVisites;
  25. }
  26. /** Documents the reason why a solver returned the solution. */
  27. public enum ExitCause {
  28. /** The solver ran out of time and had to exit. */
  29. Timeout,
  30. /** The solution has been proved optimal and thus can no longer be improved. */
  31. ProvedOptimal,
  32. /** The solver was not able to further improve the solution (e.g. blocked in a local minima. */
  33. Blocked
  34. }
  35. }