Class 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 Detail

      • 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 Detail

      • Swap

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

      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object