Class StochasticLocalSearchOnConstrProb
- java.lang.Object
-
- org.tweetyproject.math.opt.solver.Solver
-
- org.tweetyproject.math.opt.solver.StochasticLocalSearchOnConstrProb
-
public class StochasticLocalSearchOnConstrProb extends Solver
-
-
Constructor Summary
Constructors Constructor Description StochasticLocalSearchOnConstrProb(int maxIteration, int maxStepsWithNoImprove, double chanceForRandomStep)
-
Method Summary
Modifier and Type Method Description java.util.Map<Variable,Term>
chooseANeighbor(java.util.Map<Variable,Term> currSol, int minIterations, int maxIterations, double threshold, Term targetFunc)
java.util.Map<Variable,Term>
solve(GeneralConstraintSatisfactionProblem problem)
Computes a solution to the given constraint satisfaction or optimization problem, i.e.-
Methods inherited from class org.tweetyproject.math.opt.solver.Solver
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, isInstalled, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
-
-
-
Method Detail
-
chooseANeighbor
public java.util.Map<Variable,Term> chooseANeighbor(java.util.Map<Variable,Term> currSol, int minIterations, int maxIterations, double threshold, Term targetFunc)
- Parameters:
minIterations
- : the minimum amount of solutions to be createdmaxIterations
- : the maximum amount of solutions to be createdthreshold
- : if a solution with the quality of threshold is reached we do maximum 10 more triescurrSol
- : the solution that every newly created solution uses as a initial solution in createNewSol- Returns:
- the best solution that was found and is a mutant of currSol
-
solve
public java.util.Map<Variable,Term> solve(GeneralConstraintSatisfactionProblem problem) throws GeneralMathException
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 classSolver
- Parameters:
problem
- the actual problem- Returns:
- a mapping from variables of the problem to terms.
- Throws:
GeneralMathException
- if something went wrong.
-
-