Class SimpleGeneticOptimizationSolver
java.lang.Object
org.tweetyproject.math.opt.solver.Solver
org.tweetyproject.math.opt.solver.SimpleGeneticOptimizationSolver
This class implements a simple genetic optimization algorithm for solving
 optimization problems with box or equality constraints on float variables.
 Note that equality constraints are encoded in the target function!
- Author:
- Matthias Thimm
- 
Constructor SummaryConstructorsConstructorDescriptionSimpleGeneticOptimizationSolver(int populationSize, int populationIncreaseMutation, int populationIncreaseCrossOver, int minIterations, double precision) Creates a new simple genetic optimization solver.
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanReturn if solver is installedComputes a solution to the given constraint satisfaction or optimization problem, i.e.Returns the variable assignment that maximizes/minimizes the given term (which only contains variables with defined upper and lower bounds).Methods inherited from class org.tweetyproject.math.opt.solver.SolvergetDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
- 
Constructor Details- 
SimpleGeneticOptimizationSolverpublic SimpleGeneticOptimizationSolver(int populationSize, int populationIncreaseMutation, int populationIncreaseCrossOver, int minIterations, double precision) Creates a new simple genetic optimization solver.- Parameters:
- populationSize- The size of the population
- populationIncreaseMutation- 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 iterations
- precision- If an iteration improves less than this value the algorithm ends
 
 
- 
- 
Method Details- 
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.
 
- 
solveReturns the variable assignment that maximizes/minimizes the given term (which only contains variables with defined upper and lower bounds).- Parameters:
- t- the term to be evaluated
- optimization_objective- one of OptimizationProblem.MAXIMIZE, OptimizationProblem.MINIMIZE
- Returns:
- the optimal variable assignment
- Throws:
- GeneralMathException- if some issue occured during computation.
 
- 
isInstalledReturn if solver is installed- Returns:
- if solver is installed
- Throws:
- UnsupportedOperationException- UnsupportedOperationException
 
 
-