org.apache.commons.math3.optimization.direct
Class CMAESOptimizer.FitnessFunction
java.lang.Object
org.apache.commons.math3.optimization.direct.CMAESOptimizer.FitnessFunction
- Enclosing class:
- CMAESOptimizer
private class CMAESOptimizer.FitnessFunction
- extends Object
Normalizes fitness values to the range [0,1]. Adds a penalty to the
fitness value if out of range. The penalty is adjusted by calling
setValueRange().
Field Summary |
private boolean |
isRepairMode
Flag indicating whether the objective variables are forced into their
bounds if defined |
private double |
valueRange
Determines the penalty for boundary violations |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
valueRange
private double valueRange
- Determines the penalty for boundary violations
isRepairMode
private boolean isRepairMode
- Flag indicating whether the objective variables are forced into their
bounds if defined
CMAESOptimizer.FitnessFunction
public CMAESOptimizer.FitnessFunction()
- Simple constructor.
encode
public double[] encode(double[] x)
- Parameters:
x
- Original objective variables.
- Returns:
- the normalized objective variables.
decode
public double[] decode(double[] x)
- Parameters:
x
- Normalized objective variables.
- Returns:
- the original objective variables.
value
public double value(double[] point)
- Parameters:
point
- Normalized objective variables.
- Returns:
- the objective value + penalty for violated bounds.
isFeasible
public boolean isFeasible(double[] x)
- Parameters:
x
- Normalized objective variables.
- Returns:
true
if in bounds.
setValueRange
public void setValueRange(double valueRange)
- Parameters:
valueRange
- Adjusts the penalty computation.
repair
private double[] repair(double[] x)
- Parameters:
x
- Normalized objective variables.
- Returns:
- the repaired objective variables - all in bounds.
penalty
private double penalty(double[] x,
double[] repaired)
- Parameters:
x
- Normalized objective variables.repaired
- Repaired objective variables.
- Returns:
- Penalty value according to the violation of the bounds.
Copyright (c) 2003-2013 Apache Software Foundation