public class DiscreteArmijoGradient extends Optimizer
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2021, 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.
Modifier and Type | Field and Description |
---|---|
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
|
done, EXCLUDING, FS, INCLUDING, LS, MAINITERATION, ORIGINAL, SUBITERATION, TRANSFORMED
Constructor and Description |
---|
DiscreteArmijoGradient(GenOpt genOptData)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
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
private int dimX
private double Alp
private double Bet
private double Gam
private int KSta
private int K0
private int LMax
private int Kappa
private double EpsX
private double EpsM
private double[] xIni
private double fIni
private double[] dXIni
private boolean InitializeNormalization
public DiscreteArmijoGradient(GenOpt genOptData) throws OptimizerException, java.io.IOException, java.lang.Exception, InputFormatException
genOptData
- a reference to the GenOpt object.OptimizerException
- if an OptimizerException occurs or
if the user required to stop GenOptSimulationInputException
- if an error in writing the
simulation input file occursjava.lang.NoSuchMethodException
- if a method that should be invoked could not be foundjava.lang.IllegalAccessException
- if an invoked method enforces Java language access
control and the underlying method is inaccessibleInvocationTargetException
- if an invoked method throws an exceptionjava.lang.Exception
- if an I/O error in the simulation input file occursjava.io.IOException
InputFormatException
public int run(Point x0) throws SimulationInputException, OptimizerException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.Exception
run
in class Optimizer
x0
- initial point-1
if the maximum number of iteration
is exceeded
+1
if the required accuracy is reachedOptimizerException
- if an OptimizerException occurs or
if the user required to stop GenOptSimulationInputException
- if an error in writing the
simulation input file occursjava.lang.NoSuchMethodException
- if a method that should be invoked could not be foundjava.lang.IllegalAccessException
- if an invoked method enforces Java language access
control and the underlying method is inaccessibleInvocationTargetException
- if an invoked method throws an exceptionjava.lang.Exception
- if an I/O error in the simulation input file occurspublic void reportSuccessFullIterate(Point x) throws java.io.IOException, OptimizerException
MainIteration = false
and then with
MainIteration = true
x
- the point to be reportedjava.io.IOException
- if an I/O error in the optimization output files
occursOptimizerException
- thrown if the objective function value is the same
between two following main iterationspublic Point[] getF(boolean MainIteration, Point[] x) throws SimulationInputException, OptimizerException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.Exception
constraints
determines in which mode the constraints
are treatedx
MainIteration
- true
if step was a main iteration or
false
if it was a sub iterationx
- the point being evaluatedOptimizerException
- if an OptimizerException occurs or
if the user required to stop GenOptSimulationInputException
- if an error in writing the
simulation input file occursjava.lang.NoSuchMethodException
- if a method that should be invoked could not be foundjava.lang.IllegalAccessException
- if an invoked method enforces Java language access
control and the underlying method is inaccessibleInvocationTargetException
- if an invoked method throws an exceptionjava.lang.Exception
- if an I/O error in the simulation input file occurspublic Point getF(boolean MainIteration, Point x) throws SimulationInputException, OptimizerException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.Exception
getF(boolean, Point[])
and returns its valueMainIteration
- true
if step was a main iteration or
false
if it was a sub iterationx
- the point being evaluatedOptimizerException
- if an OptimizerException occurs or
if the user required to stop GenOptSimulationInputException
- if an error in writing the
simulation input file occursjava.lang.NoSuchMethodException
- if a method that should be invoked could not be foundjava.lang.IllegalAccessException
- if an invoked method enforces Java language access
control and the underlying method is inaccessibleInvocationTargetException
- if an invoked method throws an exceptionjava.lang.Exception
- if an I/O error in the simulation input file occurspublic Point getF(Point x) throws SimulationInputException, OptimizerException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.Exception
getF(boolean, Point)
with the boolean flag set to
Optimizer.SUBITERATIONgetF
in class Optimizer
x
- the point being evaluatedOptimizerException
- if an OptimizerException occurs or
if the user required to stop GenOptSimulationInputException
- if an error in writing the
simulation input file occursjava.lang.NoSuchMethodException
- if a method that should be invoked could not be foundjava.lang.IllegalAccessException
- if an invoked method enforces Java language access
control and the underlying method is inaccessibleInvocationTargetException
- if an invoked method throws an exceptionjava.lang.Exception
- if an I/O error in the simulation input file occursprivate Point _convertPointToUserUnits(Point x)
x
- the point being converted