Class Nowicki.Swap

java.lang.Object
jobshop.solvers.neighborhood.Nowicki.Swap
Enclosing class:
Nowicki

public static class Nowicki.Swap extends Object
Represents a swap of two tasks on the same machine in a ResourceOrder encoding. Consider the solution in ResourceOrder representation machine 0 : (0,1) (1,2) (2,2) machine 1 : (0,2) (2,1) (1,1) machine 2 : ... The swap with : t1= (0,2) and t2 = (2,1) Represent inversion of the two tasks : (0,2) and (2,1) Applying this swap on the above resource order should result in the following one : machine 0 : (0,1) (1,2) (2,2) machine 1 : (2,1) (0,2) (1,1) machine 2 : ...
  • Field Details

    • t1

      public final Task t1
      First task to be swapped. Invariant: this is always the task with the smallest job of the two
    • t2

      public final Task t2
      Second task to be swapped
  • Constructor Details

    • Swap

      Swap(Task t1, Task t2)
      Creates a new swap of two tasks.
  • Method Details

    • generateFrom

      public ResourceOrder generateFrom(ResourceOrder original)
      Creates a new ResourceOrder order that is the result of performing the swap in the original ResourceOrder. The original ResourceOrder MUST NOT be modified by this operation.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object