Class Shake<S extends Solution<S,I>,I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.shake.Shake<S,I>
Type Parameters:
S - Solution class
I - Instance class
Direct Known Subclasses:
DestroyRebuild, Example__RNAME__Shake, RandomMoveShake, Shake.NullShake

public abstract class Shake<S extends Solution<S,I>,I extends Instance> extends Object
Different ways to shake a solution, RandomShake for a reference implementation
See Also:
  • Constructor Details

    • Shake

      public Shake()
  • Method Details

    • shake

      public abstract S shake(S solution, int k)
      Shake the solution. Use k to calculate how powerful the shake should be in your implementation. Can be as simple as number of elements to remove, or to swap. Whatever you want.
      Parameters:
      solution - Solution to shake
      k - shake strength
      Returns:
      shaken solution. Shaken, not stirred.
    • nul

      public static <S extends Solution<S, I>, I extends Instance> Shake<S,I> nul()
      Create a no operation shake method Returns the solution immediately without executing any operation
      Type Parameters:
      S - Solution class
      I - Instance class
      Returns:
      Null shake method