fr.inria.optimization.cmaes
Class CMAOptions

java.lang.Object
  extended by fr.inria.optimization.cmaes.CMAOptions
All Implemented Interfaces:
java.io.Serializable

public class CMAOptions
extends java.lang.Object
implements java.io.Serializable

Simple container of (mostly generic) options for the optimization, like the maximum number of objective function evaluations, see class fields. No explicit setting of options is needed to initialize the CMA-ES (CMAEvolutionStrategy.init()) and options of the CMA-ES can be set and changed any time, either via a property file and the method CMAEvolutionStrategy.readProperties(), or new values can simply be assigned to the fields of the public opts field of the class CMAEvolutionStrategy (yeah, I know, not exactly Java style).

See Also:
Serialized Form

Field Summary
 int checkEigenSystem
          checks eigendecomposition mainly for debugging purpose, default is 0==no-check; the function checkEigenSystem requires O(N^3) operations.
 long diagonalCovarianceMatrix
          number of initial iterations with diagonal covariance matrix, where 1 means always.
 double[] lowerStandardDeviations
          lower bound for standard deviations (step sizes).
 double maxTimeFractionForEigendecomposition
          only for >= 1 results are always exactly reproducible, as otherwise the update of the eigensystem is conducted depending on time measurements, defaut is 0.2
 double maxTimeFractionForWriteToDefaultFiles
          default is 0.1
 java.lang.String outputFileNamesPrefix
          Output files written will have the names outputFileNamesPrefix*.dat
 double stopFitness
          stop if function value drops below the target function value stopFitness.
 long stopMaxFunEvals
          stop if the number of objective function evaluations exceed stopMaxFunEvals
 long stopMaxIter
          stop if the number of iterations (generations) exceed stopMaxIter
 boolean stopnow
          if true stopping message "Manual:..." is generated
 double stopTolFun
          stop if the maximum function value difference of all iteration-best solutions of the last 10 + 30*N/lambda iterations and all solutions of the recent iteration become <= stopTolFun.
 double stopTolFunHist
          stop if the maximum function value difference of all iteration-best solutions of the last 10 + 30*N/lambda iterations become smaller than stopTolFunHist.
 double stopTolUpXFactor
          stop if search steps become larger than stopTolUpXFactor * initial step size.
 double stopTolX
          stop if search steps become smaller than stopTolX.
 double stopTolXFactor
          stop if search steps become smaller than stopTolXFactor * initial step size.
 double[] upperStandardDeviations
          upper bound for standard deviations (step lengths).
 int verbosity
          determines whether CMA says hello after initialization.
 int writeDisplayToFile
          if chosen > 0 the console output from functions print... is saved additionally into a file, by default outcmaesdisp.dat
 
Constructor Summary
CMAOptions()
           
 
Method Summary
 java.lang.String getFirstToken(java.lang.String s)
          should become generic with type argument?
 java.lang.Double getFirstToken(java.lang.String s, java.lang.Double def)
          Returns the double value of the first token of a string s or the default, if the string is null or empty.
 java.lang.Integer getFirstToken(java.lang.String s, java.lang.Integer def)
          Returns the Integer value of the first token of a string s or the default, if the string is null or empty.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diagonalCovarianceMatrix

public long diagonalCovarianceMatrix
number of initial iterations with diagonal covariance matrix, where 1 means always. Default is diagonalCovarianceMatrix=0, but this will presumably change in future. As long as iterations<=diagonalCovarianceMatrix the internal time complexity is linear in the search space dimensionality (memory requirements remain quadratic).


lowerStandardDeviations

public double[] lowerStandardDeviations
lower bound for standard deviations (step sizes). The Array can be of any length. The i-th entry corresponds to the i-th variable. If length<dim the last entry is recycled for all remaining variables. Zero entries mean, naturally, no lower bound.

CAVE: there is an interference with stopTolX (and stopTolXFactor): if lowerStdDev is larger than stopTolX, the termination criterion can never be satisfied.

Example:

 CMAEvolutionStrategy es = new CMAEvolutionStrategy(); 
 es.options.lowerStandardDeviations = new double[]{1e-4,1e-8}; // 1e-8 for all but first variable
 

See Also:
stopTolX, stopTolXFactor

upperStandardDeviations

public double[] upperStandardDeviations
upper bound for standard deviations (step lengths). Zero entries mean no upper bound. Be aware of the interference with option stopTolUpXFactor.

See Also:
lowerStandardDeviations, stopTolUpXFactor

stopFitness

public double stopFitness
stop if function value drops below the target function value stopFitness. Default = Double.MIN_VALUE


stopTolFun

public double stopTolFun
stop if the maximum function value difference of all iteration-best solutions of the last 10 + 30*N/lambda iterations and all solutions of the recent iteration become <= stopTolFun. Default = 1e-12.


stopTolFunHist

public double stopTolFunHist
stop if the maximum function value difference of all iteration-best solutions of the last 10 + 30*N/lambda iterations become smaller than stopTolFunHist. Default = 1e-13. The measured objective function value differences do not include repair penalties.


stopTolX

public double stopTolX
stop if search steps become smaller than stopTolX. Default = 0


stopTolXFactor

public double stopTolXFactor
stop if search steps become smaller than stopTolXFactor * initial step size. Default = 1e-11.


stopTolUpXFactor

public double stopTolUpXFactor
stop if search steps become larger than stopTolUpXFactor * initial step size. Default = 1e3. When this termination criterion applies on a static objective function, the initial step-size was chosen far too small (or divergent behavior is observed).


stopMaxFunEvals

public long stopMaxFunEvals
stop if the number of objective function evaluations exceed stopMaxFunEvals


stopMaxIter

public long stopMaxIter
stop if the number of iterations (generations) exceed stopMaxIter


stopnow

public boolean stopnow
if true stopping message "Manual:..." is generated


verbosity

public int verbosity
determines whether CMA says hello after initialization.

See Also:
CMAEvolutionStrategy.helloWorld()

outputFileNamesPrefix

public java.lang.String outputFileNamesPrefix
Output files written will have the names outputFileNamesPrefix*.dat


writeDisplayToFile

public int writeDisplayToFile
if chosen > 0 the console output from functions print... is saved additionally into a file, by default outcmaesdisp.dat


maxTimeFractionForEigendecomposition

public double maxTimeFractionForEigendecomposition
only for >= 1 results are always exactly reproducible, as otherwise the update of the eigensystem is conducted depending on time measurements, defaut is 0.2


maxTimeFractionForWriteToDefaultFiles

public double maxTimeFractionForWriteToDefaultFiles
default is 0.1


checkEigenSystem

public int checkEigenSystem
checks eigendecomposition mainly for debugging purpose, default is 0==no-check; the function checkEigenSystem requires O(N^3) operations.

Constructor Detail

CMAOptions

public CMAOptions()
Method Detail

getFirstToken

public java.lang.Double getFirstToken(java.lang.String s,
                                      java.lang.Double def)
Returns the double value of the first token of a string s or the default, if the string is null or empty. This method should become generic with respect to the type of second argument.

Parameters:
s - string where the first token is read from
def - double default value, in case the string is empty

getFirstToken

public java.lang.String getFirstToken(java.lang.String s)
should become generic with type argument?


getFirstToken

public java.lang.Integer getFirstToken(java.lang.String s,
                                       java.lang.Integer def)
Returns the Integer value of the first token of a string s or the default, if the string is null or empty. This method should become generic with respect to the type of second argument.

Parameters:
s - string where the first token is read from
def - Integer default value, in case the string is empty