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

java.lang.Object
es.urjc.etsii.grafo.algorithms.scattersearch.SolutionCombinator<S,I>

public abstract class SolutionCombinator<S extends Solution<S,I>,I extends Instance> extends Object
  • Constructor Details

    • SolutionCombinator

      public SolutionCombinator()
  • Method Details

    • newSet

      public Set<S> newSet(S[] currentSet, Set<S> newSolutions)
      Returns new reference set starting from current reference set
      Parameters:
      currentSet - current reference set, DO NOT MODIFY
      newSolutions - solutions added to refset in last iteration
      Returns:
      new reference set
    • apply

      protected abstract List<S> apply(S left, S right)
      Create a new solution combining left and right. If this method is not flexible enough, leave an empty implementation (throw new UnsupportedOperationException) and override method newSet
      Parameters:
      left - origin solution, one of the recently added solutions to the refset
      right - target solution, one of the old solutions in the ref set
      Returns:
      new solution, such as List.of(solution) or list of solutions generated from the solutions given as parameters
    • toString

      public String toString()
      Overrides:
      toString in class Object