public class SimpleGeneticOptimizationSolver extends Solver
| Constructor and Description |
|---|
SimpleGeneticOptimizationSolver(int populationSize,
int populationIncreaseMutation,
int populationIncreaseCrossOver,
int minIterations,
double precision)
Creates a new simple genetic optimization solver.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isInstalled() |
Map<Variable,Term> |
solve(ConstraintSatisfactionProblem problem)
Computes a solution to the given constraint satisfaction or optimization problem, i.e.
|
Map<Variable,Term> |
solve(Term t,
int optimization_objective)
Returns the variable assignment that maximizes/minimizes the given term
(which only contains variables with defined upper and lower bounds).
|
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolverpublic SimpleGeneticOptimizationSolver(int populationSize,
int populationIncreaseMutation,
int populationIncreaseCrossOver,
int minIterations,
double precision)
populationSize - The size of the populationpopulationIncreaseMutation - How many new individuals are created by mutation (per individual)populationIncreaseCrossOver - How many new individuals are created by cross-over (per pair of individuals)minIterations - The minimal number of iterationsprecision - If an iteration improves less than this value the algorithm endspublic Map<Variable,Term> solve(ConstraintSatisfactionProblem problem) throws GeneralMathException
Solversolve in class Solverproblem - the actual problemGeneralMathException - if something went wrong.public Map<Variable,Term> solve(Term t, int optimization_objective) throws GeneralMathException
t - the term to be evaluatedoptimization_objective - one of OptimizationProblem.MAXIMIZE, OptimizationProblem.MINIMIZEGeneralMathExceptionpublic static boolean isInstalled()
throws UnsupportedOperationException
UnsupportedOperationExceptionCopyright © 2018. All rights reserved.