Class ApacheCommonsCMAESOptimizer
java.lang.Object
org.tweetyproject.math.opt.solver.Solver
org.tweetyproject.math.opt.solver.ApacheCommonsCMAESOptimizer
This class is a wrapper for the Apache Commons Math3 CMAES optimizer
(https://commons.apache.org/proper/commons-math/).
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionApacheCommonsCMAESOptimizer
(int populationSize, int maxIterations, double stopFitness, boolean isActiveCMA, int diagonalOnly, int checkFeasableCount, double precision) Parameters from org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer: -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Return if it 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.Solver
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
Constructor Details
-
ApacheCommonsCMAESOptimizer
public ApacheCommonsCMAESOptimizer(int populationSize, int maxIterations, double stopFitness, boolean isActiveCMA, int diagonalOnly, int checkFeasableCount, double precision) Parameters from org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer:- Parameters:
populationSize
- the population sizemaxIterations
- Maximal number of iterations.stopFitness
- Whether to stop if objective function value is smaller than stopFitness.isActiveCMA
- Chooses the covariance matrix update method.diagonalOnly
- Number of initial iterations, where the covariance matrix remains diagonal.checkFeasableCount
- Determines how often new random objective variables are generated in case they are out of bounds.precision
- the precision of the optimization
-
-
Method Details
-
solve
public 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.
-
solve
Returns 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 evaluatedoptimization_type
- one of OptimizationProblem.MAXIMIZE, OptimizationProblem.MINIMIZE- Returns:
- the optimal variable assignment
- Throws:
GeneralMathException
- if there is some issue in the computation
-
isInstalled
Return if it is installed- Returns:
- if it is installed
- Throws:
UnsupportedOperationException
- UnsupportedOperationException
-