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.

Task.java 928B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package jobshop.encodings;
  2. import java.util.Objects;
  3. /** Represents a task (job,task) of a jobshop problem.
  4. *
  5. * Example : (2, 3) represents the fourth task of the third job. (remember that we start counting at 0)
  6. **/
  7. public final class Task {
  8. /** Identifier of the job */
  9. public final int job;
  10. /** Index of the task inside the job. */
  11. public final int task;
  12. public Task(int job, int task) {
  13. this.job = job;
  14. this.task = task;
  15. }
  16. @Override
  17. public boolean equals(Object o) {
  18. if (this == o) return true;
  19. if (o == null || getClass() != o.getClass()) return false;
  20. Task task1 = (Task) o;
  21. return job == task1.job &&
  22. task == task1.task;
  23. }
  24. @Override
  25. public int hashCode() {
  26. return Objects.hash(job, task);
  27. }
  28. @Override
  29. public String toString() {
  30. return "(" + job +", " + task + ')';
  31. }
  32. }