genopt.algorithm
Class DiscreteArmijoGradient

java.lang.Object
  extended by genopt.algorithm.Optimizer
      extended by genopt.algorithm.DiscreteArmijoGradient

public class DiscreteArmijoGradient
extends Optimizer

Class for minimizing a function using the Discrete Armijo Gradient 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  double Alp
          Algorithm parameter
private  double Bet
          Algorithm parameter
private  int dimX
          The number of independent variables
private  double[] dXIni
          Step size for scaling of the independent parameters
private  double EpsM
          Relative accuracy of gradient approximation
private  double EpsX
          Relative accuracy of independent parameter before optimization stops
private  double fIni
          Initial values of the cost function
private  double Gam
          Algorithm parameter
private  boolean InitializeNormalization
          Flag whether the normalization must be initialized
private  int K0
          Algorithm parameter
private  int Kappa
          Algorithm parameter
private  int KSta
          Algorithm parameter
private  int LMax
          Algorithm parameter
private  double[] xIni
          Initial values of the independent parameters
 
Fields inherited from class genopt.algorithm.Optimizer
done, EXCLUDING, FS, INCLUDING, LS, MAINITERATION, ORIGINAL, SUBITERATION, TRANSFORMED
 
Constructor Summary
DiscreteArmijoGradient(GenOpt genOptData)
          Constructor
 
Method Summary
private  Point _convertPointToUserUnits(Point x)
          Converts the argument's independent parameters to the units used in the simulation input.
 Point getF(boolean MainIteration, Point x)
          Evaluates the simulation based on the parameter set x and reports the point.
 Point[] getF(boolean MainIteration, Point[] x)
          Evaluates the simulation based on the parameter set x
The value constraints determines in which mode the constraints are treated After this call, the parameters in the original and in the transformed space are set to the values that correspond to x The step size in the transformed space is updated according to the transformation function A new input file is writen the simulation is launched simulation errors are checked the value of the objective function is returned
 Point getF(Point x)
          Computes a function evaluation and reports the point as a sub iteration.
 void reportSuccessFullIterate(Point x)
          Reports the new trial and updates the parameters updates the original value updates the transformed value updates the transformed step size reports the new trial reports the objective function value increases the number of the iteration Note: If a sub iteration is also a main iteration, then you have to call this function twice, first with MainIteration = false and then with MainIteration = true
 int run(Point x0)
          Runs the optimization process until a termination criteria is satisfied
 
Methods inherited from class genopt.algorithm.Optimizer
algorithmRequiresUsageOfStepNumber, appendToOutputListing, checkMaxIteration, checkObjectiveFunctionValue, 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, getMinimumPoint, getMode, getObjectiveFunctionName, getOutputPath, getPointerToEqualPoints, getRelAccuracyFunction, getSimulationNumber, getStepNumber, getU, getVariableNameContinuous, getVariableNameDiscrete, getX0, getX0, goToEndOfCommandFile, increaseStepNumber, increaseStepNumber, isFeasible, isNextToken, maxIterationReached, mustStopOptimization, print, println, replace, report, reportCurrentLowestPoint, reportMinimum, 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

dimX

private int dimX
The number of independent variables


Alp

private double Alp
Algorithm parameter


Bet

private double Bet
Algorithm parameter


Gam

private double Gam
Algorithm parameter


KSta

private int KSta
Algorithm parameter


K0

private int K0
Algorithm parameter


LMax

private int LMax
Algorithm parameter


Kappa

private int Kappa
Algorithm parameter


EpsX

private double EpsX
Relative accuracy of independent parameter before optimization stops


EpsM

private double EpsM
Relative accuracy of gradient approximation


xIni

private double[] xIni
Initial values of the independent parameters


fIni

private double fIni
Initial values of the cost function


dXIni

private double[] dXIni
Step size for scaling of the independent parameters


InitializeNormalization

private boolean InitializeNormalization
Flag whether the normalization must be initialized

Constructor Detail

DiscreteArmijoGradient

public DiscreteArmijoGradient(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
Method Detail

run

public int run(Point x0)
        throws SimulationInputException,
               OptimizerException,
               java.lang.NoSuchMethodException,
               java.lang.IllegalAccessException,
               java.lang.Exception
Runs the optimization process until a termination criteria is satisfied

Specified by:
run in class Optimizer
Parameters:
x0 - initial point
Returns:
-1 if the maximum number of iteration is exceeded
+1 if the required accuracy is reached
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

reportSuccessFullIterate

public void reportSuccessFullIterate(Point x)
                              throws java.io.IOException,
                                     OptimizerException
Reports the new trial and updates the parameters Note: If a sub iteration is also a main iteration, then you have to call this function twice, first with MainIteration = false and then with MainIteration = true

Parameters:
x - the point to be reported
Throws:
java.io.IOException - if an I/O error in the optimization output files occurs
OptimizerException - thrown if the objective function value is the same between two following main iterations

getF

public Point[] getF(boolean MainIteration,
                    Point[] x)
             throws SimulationInputException,
                    OptimizerException,
                    java.lang.NoSuchMethodException,
                    java.lang.IllegalAccessException,
                    java.lang.Exception
Evaluates the simulation based on the parameter set x
The value constraints determines in which mode the constraints are treated

Parameters:
MainIteration - true if step was a main iteration or false if it was a sub iteration
x - the point being evaluated
Returns:
a clone of the point with the new function values stored
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

getF

public Point getF(boolean MainIteration,
                  Point x)
           throws SimulationInputException,
                  OptimizerException,
                  java.lang.NoSuchMethodException,
                  java.lang.IllegalAccessException,
                  java.lang.Exception
Evaluates the simulation based on the parameter set x and reports the point. This method simply calls the vectorized form getF(boolean, Point[]) and returns its value

Parameters:
MainIteration - true if step was a main iteration or false if it was a sub iteration
x - the point being evaluated
Returns:
a clone of the point with the new function values stored
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

getF

public Point getF(Point x)
           throws SimulationInputException,
                  OptimizerException,
                  java.lang.NoSuchMethodException,
                  java.lang.IllegalAccessException,
                  java.lang.Exception
Computes a function evaluation and reports the point as a sub iteration. This method calls getF(boolean, Point) with the boolean flag set to Optimizer.SUBITERATION

Overrides:
getF in class Optimizer
Parameters:
x - the point being evaluated
Returns:
a clone of the point with the new function values stored
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

_convertPointToUserUnits

private Point _convertPointToUserUnits(Point x)
Converts the argument's independent parameters to the units used in the simulation input.

Parameters:
x - the point being converted
Returns:
the point with the independent parameters converted to the units used in the simulation input