Interface VNSNeighChange<S extends Solution<S,I>,I extends Instance>

All Superinterfaces:
BiFunction<S,Integer,Integer>
All Known Implementing Classes:
DefaultVNSNeighChange
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface VNSNeighChange<S extends Solution<S,I>,I extends Instance> extends BiFunction<S,Integer,Integer>
Calculates K value for each VNS step. See DefaultVNSNeighChange for an example implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(S solution, Integer originalK)
    Implements the neighborhood change strategy for VNS.

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Field Details

  • Method Details

    • apply

      Integer apply(S solution, Integer originalK)
      Implements the neighborhood change strategy for VNS. K starts at 0 and can be incremented or modified based on the solution's state.
      Specified by:
      apply in interface BiFunction<S extends Solution<S,I>,Integer,Integer>
      Parameters:
      solution - Current solution, provided as a parameter so K can be adapted or scaled to instance size.
      originalK - Current k strength. Starts at 0 and increments by 1 each time the solution does not improve.
      Returns:
      new K value. Return STOPNOW to stop when the VNS should terminate