Class StochasticLocalSearchOnConstrProb
java.lang.Object
org.tweetyproject.math.opt.solver.Solver
org.tweetyproject.math.opt.solver.StochasticLocalSearchOnConstrProb
Stochastic Local Search On Constraint Problem
- Author:
- Sebastian Franke
- 
Constructor SummaryConstructorsConstructorDescriptionStochasticLocalSearchOnConstrProb(int maxIteration, int maxStepsWithNoImprove, double chanceForRandomStep) Constructor
- 
Method SummaryModifier and TypeMethodDescriptionchooseANeighbor(Map<Variable, Term> currSol, int minIterations, int maxIterations, double threshold, Term targetFunc) Return the best solution that was found and is a mutant of currSolComputes a solution to the given constraint satisfaction or optimization problem, i.e.Methods inherited from class org.tweetyproject.math.opt.solver.SolvergetDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, isInstalled, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
- 
Constructor Details- 
StochasticLocalSearchOnConstrProbpublic StochasticLocalSearchOnConstrProb(int maxIteration, int maxStepsWithNoImprove, double chanceForRandomStep) Constructor- Parameters:
- maxIteration- maxIteration
- maxStepsWithNoImprove- maxStepsWithNoImprove
- chanceForRandomStep- chanceForRandomStep
 
 
- 
- 
Method Details- 
chooseANeighborpublic Map<Variable,Term> chooseANeighbor(Map<Variable, Term> currSol, int minIterations, int maxIterations, double threshold, Term targetFunc) Return the best solution that was found and is a mutant of currSol- Parameters:
- currSol- : the solution that every newly created solution uses as a initial solution in createNewSol
- 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
- targetFunc- the target function
- Returns:
- the best solution that was found and is a mutant of currSol
 
- 
solvepublic Map<Variable,Term> solve(GeneralConstraintSatisfactionProblem problem) throws GeneralMathException Description copied from class:SolverComputes a solution to the given constraint satisfaction or optimization problem, i.e. a mapping from variables of the problem to terms.- Specified by:
- solvein class- Solver
- Parameters:
- problem- the actual problem
- Returns:
- a mapping from variables of the problem to terms.
- Throws:
- GeneralMathException- if something went wrong.
 
 
-