genopt.algorithm
Class GPSCoordinateSearch

java.lang.Object
  extended by genopt.algorithm.Optimizer
      extended by genopt.algorithm.util.gps.ModelGPS
          extended by genopt.algorithm.GPSCoordinateSearch
Direct Known Subclasses:
GPSHookeJeeves

public class GPSCoordinateSearch
extends ModelGPS

Class for minimizing a function using the coordinate search algorithm.

This project was carried out at:

and supported by

GenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Version:
GenOpt(R) 3.1.0 (December 8, 2011)

Author:
Michael Wetter

Field Summary
private  int[] cooPoi
          Array with element 0 or 1, if the previous step in this direction was successful or failed, respectively
private  int dimX
          The number of independent variables
 
Fields inherited from class genopt.algorithm.util.gps.ModelGPS
basDirMat, checkObjFun, EMPTY_SEARCH_SET, FAIMOV, NEGDIR, nMaxSteRed, POSDIR, SUCMOV
 
Fields inherited from class genopt.algorithm.Optimizer
done, EXCLUDING, FS, INCLUDING, LS, MAINITERATION, ORIGINAL, SUBITERATION, TRANSFORMED
 
Constructor Summary
GPSCoordinateSearch(GenOpt genOptData)
          Constructor
GPSCoordinateSearch(int meshSizeDivider, int initialMeshSizeExponent)
          Constructor used to run the algorithm in a hybrid algorithm for the last iterations.
 
Method Summary
protected  Point[] globalSearch(Point[] x, double delta)
          Method for the global search (this method returns always null.
protected  double[][] initializeBaseDirectionMatrix()
          Method that initializes the base direction matrix.
protected  Point[] localSearch(Point[] x, double delta)
          Method for the local search.
private  Point perturb(Point xBes, double delta, int i)
          Perturbs a given point in one direction.
private  void reportFailure(Point x, int i)
          Reports a trial that yield no reduction in the cost function value.
private  void reportSuccess(Point x, int i)
          Reports a trial that reduced the cost function value.
 
Methods inherited from class genopt.algorithm.util.gps.ModelGPS
add, checkObjectiveFunctionValue, getClosestEuclideanMeshPoint, getDelta, getF, getIndexLowestFunctionValue, getInitialDelta, getIterationNumber, getMaximumNumberOfStepReduction, getMinimumPoint, getNumberOfStepReduction, haveSufficientDecrease, report, reportMinimum, reportMinimum, run, setMaximumNumberOfStepReduction
 
Methods inherited from class genopt.algorithm.Optimizer
algorithmRequiresUsageOfStepNumber, appendToOutputListing, checkMaxIteration, ensureOnlyContinuousParameters, ensureOnlyDiscreteParameters, getAbsAccuracyFunction, getDimensionContinuous, getDimensionDiscrete, getDimensionF, getDimensionX, getDiscreteValueDouble0, getDx, getDx0, getF, getIndex0, getIndex0, getInputValueBoolean, getInputValueDouble, getInputValueDouble, getInputValueInteger, getInputValueInteger, getInputValueString, getInputValueString, getKindOfConstraint, getL, getLengthDiscrete, getMainIterationNumber, getMaximumThreadPoolSize, getMaxIterationNumber, getMode, getObjectiveFunctionName, getOutputPath, getPointerToEqualPoints, getRelAccuracyFunction, getSimulationNumber, getStepNumber, getU, getVariableNameContinuous, getVariableNameDiscrete, getX0, getX0, goToEndOfCommandFile, increaseStepNumber, increaseStepNumber, isFeasible, isNextToken, maxIterationReached, mustStopOptimization, print, println, replace, reportCurrentLowestPoint, resetStepNumber, roundCoordinates, run, setInfo, setMode, setNumberOfMatchingResults, setToFeasibleCoordinate, setToFeasibleCoordinate, setWarning, simulate, throwInputError, useStepNumber, writeStepNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cooPoi

private int[] cooPoi
Array with element 0 or 1, if the previous step in this direction was successful or failed, respectively


dimX

private int dimX
The number of independent variables

Constructor Detail

GPSCoordinateSearch

public GPSCoordinateSearch(GenOpt genOptData)
                    throws OptimizerException,
                           java.io.IOException,
                           java.lang.Exception,
                           InputFormatException
Constructor

Parameters:
genOptData - a reference to the GenOpt object.
Note: the object is used as a reference. Hence, the data of GenOpt are modified by this Class.
Throws:
OptimizerException - if an OptimizerException occurs or if the user required to stop GenOpt
SimulationInputException - if an error in writing the simulation input file occurs
java.lang.NoSuchMethodException - if a method that should be invoked could not be found
java.lang.IllegalAccessException - if an invoked method enforces Java language access control and the underlying method is inaccessible
InvocationTargetException - if an invoked method throws an exception
java.lang.Exception - if an I/O error in the simulation input file occurs
java.io.IOException
InputFormatException

GPSCoordinateSearch

public GPSCoordinateSearch(int meshSizeDivider,
                           int initialMeshSizeExponent)
                    throws OptimizerException,
                           java.io.IOException,
                           java.lang.Exception,
                           InputFormatException
Constructor used to run the algorithm in a hybrid algorithm for the last iterations.

Parameters:
meshSizeDivider - the mesh size divider. If set to Integer.MAX_VALUE, then the value will be read from the command file
initialMeshSizeExponent - the initial mesh size exponent. If set to Integer.MAX_VALUE, then the value will be read from the command file
Throws:
OptimizerException
java.lang.Exception
java.io.IOException - if an I/O exception occurs
InputFormatException
Method Detail

initializeBaseDirectionMatrix

protected double[][] initializeBaseDirectionMatrix()
Method that initializes the base direction matrix.

Each column vector is a direction, and the set of column vectors must be a positive span for the domain of independent parameters.

Specified by:
initializeBaseDirectionMatrix in class ModelGPS
Returns:
baseDireMat the base direction matrix

globalSearch

protected Point[] globalSearch(Point[] x,
                               double delta)
                        throws SimulationInputException,
                               OptimizerException,
                               java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException,
                               java.lang.Exception
Method for the global search (this method returns always null.

Specified by:
globalSearch in class ModelGPS
Parameters:
x - Sequence of previous iterates
delta - current mesh size
Returns:
the null pointer
Throws:
OptimizerException - if an OptimizerException occurs or if the user required to stop GenOpt
SimulationInputException - if an error in writing the simulation input file occurs
java.lang.NoSuchMethodException - if a method that should be invoked could not be found
java.lang.IllegalAccessException - if an invoked method enforces Java language access control and the underlying method is inaccessible
InvocationTargetException - if an invoked method throws an exception
java.lang.Exception - if an I/O error in the simulation input file occurs

localSearch

protected Point[] localSearch(Point[] x,
                              double delta)
                       throws SimulationInputException,
                              OptimizerException,
                              java.lang.NoSuchMethodException,
                              java.lang.IllegalAccessException,
                              java.lang.Exception
Method for the local search.

Specified by:
localSearch in class ModelGPS
Parameters:
x - Sequence of previous iterates
delta - current mesh size
Returns:
the sequence of points that have been evaluated in the local search.
Throws:
OptimizerException - if an OptimizerException occurs or if the user required to stop GenOpt
SimulationInputException - if an error in writing the simulation input file occurs
java.lang.NoSuchMethodException - if a method that should be invoked could not be found
java.lang.IllegalAccessException - if an invoked method enforces Java language access control and the underlying method is inaccessible
InvocationTargetException - if an invoked method throws an exception
java.lang.Exception - if an I/O error in the simulation input file occurs

perturb

private Point perturb(Point xBes,
                      double delta,
                      int i)
               throws SimulationInputException,
                      OptimizerException,
                      java.lang.NoSuchMethodException,
                      java.lang.IllegalAccessException,
                      java.lang.Exception
Perturbs a given point in one direction.

The value of cooPoi determines whether a point will first be perturbed along the negative or positive coordinate direction.

Parameters:
xBes - Point to be perturbed
delta - current mesh size
i - index of independent parameter that has to be perturbed
Returns:
the point with the lowest obtained function value. If the method could not reduce the cost, then a clone of xBes is returned.
Throws:
OptimizerException - if an OptimizerException occurs or if the user required to stop GenOpt
SimulationInputException - if an error in writing the simulation input file occurs
java.lang.NoSuchMethodException - if a method that should be invoked could not be found
java.lang.IllegalAccessException - if an invoked method enforces Java language access control and the underlying method is inaccessible
InvocationTargetException - if an invoked method throws an exception
java.lang.Exception - if an I/O error in the simulation input file occurs

reportSuccess

private void reportSuccess(Point x,
                           int i)
                    throws java.io.IOException,
                           OptimizerException
Reports a trial that reduced the cost function value.

Parameters:
x - the point that will be reported
i - the coordinate that has been perturbed
Throws:
java.io.IOException - if an error occurs
OptimizerException - if an error occurs

reportFailure

private void reportFailure(Point x,
                           int i)
                    throws java.io.IOException,
                           OptimizerException
Reports a trial that yield no reduction in the cost function value.

Parameters:
x - the point that will be reported
i - the coordinate that has been perturbed
Throws:
java.io.IOException - if an error occurs
OptimizerException - if an error occurs