public class ApacheCommonsCMAESOptimizer extends Solver
Modifier and Type | Field and Description |
---|---|
private int |
checkFeasableCount
Determines how often new random objective variables are generated in case they are out of bounds.
|
private int |
diagonalOnly
Number of initial iterations, where the covariance matrix remains diagonal.
|
private boolean |
isActiveCMA
Chooses the covariance matrix update method.
|
private int |
maxIterations
Maximal number of iterations.
|
private int |
populationSize
population size
|
private double |
precision
the precision of the optimization
|
private double |
stopFitness
Whether to stop if objective function value is smaller than stopFitness.
|
Constructor and Description |
---|
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:
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isInstalled() |
java.util.Map<Variable,Term> |
solve(ConstraintSatisfactionProblem problem)
Computes a solution to the given constraint satisfaction or optimization problem, i.e.
|
java.util.Map<Variable,Term> |
solve(Term t,
int optimization_type)
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, setDefaultLinearSolver
private int populationSize
private int maxIterations
private double stopFitness
private boolean isActiveCMA
private int diagonalOnly
private int checkFeasableCount
private double precision
public ApacheCommonsCMAESOptimizer(int populationSize, int maxIterations, double stopFitness, boolean isActiveCMA, int diagonalOnly, int checkFeasableCount, double precision)
maxIterations
- 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 optimizationpublic java.util.Map<Variable,Term> solve(ConstraintSatisfactionProblem problem) throws GeneralMathException
Solver
solve
in class Solver
problem
- the actual problemGeneralMathException
- if something went wrong.public java.util.Map<Variable,Term> solve(Term t, int optimization_type) throws GeneralMathException
t
- the term to be evaluatedoptimization_objective
- one of OptimizationProblem.MAXIMIZE, OptimizationProblem.MINIMIZEGeneralMathException
public static boolean isInstalled() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException