Class IteratedLocalSearchOnConstrProb


  • public class IteratedLocalSearchOnConstrProb
    extends Solver
    implements the Iterates local search algorithm for optimization problems
    Author:
    Sebastian Franke
    • Constructor Detail

      • IteratedLocalSearchOnConstrProb

        public IteratedLocalSearchOnConstrProb​(double perturbationStrength,
                                               int maxnumberOfRestarts,
                                               int maxIterations)
    • Method Detail

      • bestNeighbor

        public java.util.Map<Variable,​Term> bestNeighbor​(java.util.Map<Variable,​Term> currSol,
                                                               int minIterations,
                                                               int maxIterations,
                                                               double threshold,
                                                               Term t)
        Parameters:
        minIterations - : the minimum amount of solutions to be created
        maxIterations - : the maximum amount of solutions to be created
        threshold - : if a solution with the quality of threshold is reached we do maximum 10 more tries
        currSol - : the solution that every newly created solution uses as a initial solution in createNewSol
        t - : some term
        Returns:
        the best solution that was found and is a mutant of currSol
      • pertubate

        public java.util.Map<Variable,​Term> pertubate​(java.util.Map<Variable,​Term> currSol)
        changes the solution drastically to escape a local minimum
        Parameters:
        currSol - the solution to be pertubated
        Returns:
        a new mapping
      • evaluate

        public double evaluate​(java.util.Map<Variable,​Term> sol,
                               Term minT)
      • solve

        public java.util.Map<Variable,​Term> solve​(GeneralConstraintSatisfactionProblem problem)
        Description copied from class: Solver
        Computes a solution to the given constraint satisfaction or optimization problem, i.e. a mapping from variables of the problem to terms.
        Specified by:
        solve in class Solver
        Parameters:
        problem - the actual problem
        Returns:
        a mapping from variables of the problem to terms.