public class GenOpt
extends java.lang.Thread
This project was carried out at:
and supported byThe version numbering format is M.m.P.s, where M is the major version number, m is the minor version number, P is the patch level, and s is the snapshot number. Full releases have P set to zero, and it is incremented for each subsequent bug fix release on the post-release stable branch. The snapshot number s is present only for between-release snapshots of the development and stable branches.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov.
NOTICE. This software was developed under partial funding from the U.S. Department of Energy. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright is obtained from the U.S. Department of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
(3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, U.S. Dept. of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACKNOWLEDGMENT
Describe constant
ACKNOWLEDGMENT here. |
static java.lang.String |
AUTHOR
Describe constant
AUTHOR here. |
ContinuousParameter[] |
conPar
continuous parameters
|
static java.lang.String |
COPYRIGHT
Describe constant
COPYRIGHT here. |
static boolean |
DEBUG
Flag whether we are in debug mode or not.
|
static java.lang.String |
DEBUG_WARNING
String containing the debug warning.
|
protected int |
dimCon
dimension of the continuous parameters
|
protected int |
dimDis
dimension of the discrete parameters
|
protected int |
dimInpFun
dimension of the input functions
|
DiscreteParameter[] |
disPar
discrete parameters
|
static java.lang.String |
DIVIDER
Divider for output.
|
ErrorChecker |
ErrChe
error checker
|
private static int |
exiFla
exit flag of the optimization
|
InfoManager |
infMan
info manager
|
InputFunction[] |
inpFun
input functions
|
IOSettings |
ioSet
io settings
|
private static java.lang.String |
LS
Line separator
|
private java.lang.String |
maiAlg
name of the main algorithm
|
OptimizationIni |
OptIni
optimization initialization
|
private java.lang.String |
optIniFilNam
name of optimization ini file
|
private java.lang.String |
optIniPat
path of optimization ini file
|
OptimizationSettings |
OptSet
optimization settings
|
private Preference |
pref
user preference
|
static java.lang.String |
PROGRAMINFO
Program information.
|
ResultChecker |
resChe
result Checker
|
ResultManager |
ResMan
result manager
|
static java.lang.String |
RUNHEADER
Describe constant
RUNHEADER here. |
SimulationStarter |
SimSta
simulation starter
|
protected java.util.Date |
startDate
date when the optimization started
|
private static boolean |
stopGenOpt
flag to indicate whether GenOpt has to be stopped
after the current simulation
|
private static boolean |
suspend
flag to indicate whether GenOpt has to be suspended
|
static java.lang.String |
USER_STOP_MESSAGE
Message that appears if the user stops GenOpt.
|
java.lang.String |
USERDIR
User directory (working directory).
|
static java.lang.String |
VERSION
Describe constant
VERSION here. |
static java.lang.String |
VERSION_ID
Describe constant
VERSION_ID here. |
static java.lang.String |
VERSION_NUMBER
Describe constant
VERSION_NUMBER here. |
static java.lang.String |
VERSIONINFO
Version string.
|
WarningManager |
warMan
warning manager
|
protected WinGenOpt |
wgo
reference to WinGenOpt
|
Constructor and Description |
---|
GenOpt()
allocates a new GenOpt Object containing nothing
|
GenOpt(java.lang.String optIniFileName,
InputFormatException inpForExc,
WinGenOpt windowVersion)
allocates a new GenOpt Object
|
Modifier and Type | Method and Description |
---|---|
private void |
flushLogFile(java.lang.String content)
writes physically the log file
GenOpt.log to
the log directory. |
java.io.StreamTokenizer |
getAlgorithmSection()
gets a StreamTokenizer whereas its pointer points to the start of
the
Algorithm sectionThe pointer in the StreamTokenizer is moved beyond the section start character ('{'). |
java.io.StreamTokenizer |
getAlgorithmSection(InputFormatException e)
gets a StreamTokenizer whereas its pointer points to the start of
the
Algorithm sectionThe pointer in the StreamTokenizer is moved beyond the section start character ('{'). |
int |
getDimensionContinuous()
gets the number of the continuous parameters
|
int |
getDimensionDiscrete()
gets the number of discrete parameters
|
int |
getExitFlag()
gets the exit flag of the optimization run
|
private void |
getFunctionInput(java.io.StreamTokenizer optComStrTok,
InputFormatException inpForExc,
java.lang.String fn)
makes an instance of a function input.
|
protected java.io.File |
getIniStartUpFile()
gets the initialization startup file
|
static javax.swing.JFileChooser |
getInitializationFileChooser(java.io.File IniStartUpFile)
gets an optimization initialization file chooser
|
java.lang.String |
getMainAlgorithm()
gets the name of the main algorithm
|
private java.lang.String[] |
getMultipleStringPairs(java.lang.String[] keys,
boolean[] required,
java.io.StreamTokenizer st,
InputFormatException ife,
java.lang.String fn)
gets the entries of the
keys pair in a string array. |
private OrderedMap |
getObjectiveFunctionDelimiter(java.io.StreamTokenizer st,
InputFormatException ife,
java.lang.String fn)
gets the entries of the objective function delimiter
|
java.io.File |
getOptimizationIniFile()
gets the optimization ini file
|
private Optimizer |
getOptimizer()
gets a new instance of the Optimizer object
|
private void |
getParameterInput(java.io.StreamTokenizer optComStrTok,
InputFormatException inpForExc,
java.lang.String fn)
makes an instance of a free Parameter.
|
protected java.lang.String |
getRunInfo()
gets the GenOpt run info for output report
|
java.lang.String |
getRuntime(java.util.Date now)
gets the current runtime of the optimization in the format
xhh:mm:ss |
java.lang.String |
getSeparator()
gets the separator, as specified in properties.txt
|
java.util.Date |
getStartDate()
gets the start date of the optimization
|
private void |
initializeOptimizationIniName(java.lang.String optIniFileName)
initializes the optimization ini file name and path
|
private void |
instantiateErrChe_SimSta(InputFormatException inpForExc)
makes an instance of ErrorChecker, SimulationStarter, and sets the data
member 'ObjectiveFunctionLocation' in the instance of OptimizationIni
|
private void |
instantiateErrorChecker(java.io.StreamTokenizer optCfgStrTok,
InputFormatException inpForExc,
java.lang.String fn)
makes an instance of ErrorChecker
|
private void |
instantiateFreePar_OptSet_ResChe_maiAlg(InputFormatException inpForExc,
int maxEqualResults)
makes an instance of FreePar, OptimizationSettings, and
ResultChecker
|
private void |
instantiateFreePar(java.io.StreamTokenizer optComStrTok,
InputFormatException inpForExc,
java.lang.String fn)
makes all instances of FreePar and input functions
|
private void |
instantiateIOSettings(java.io.StreamTokenizer optCfgStrTok,
InputFormatException inpForExc,
java.lang.String fn)
sets the accuracy of the file writing (number format)
|
private OrderedMap |
instantiateOptimizationIni(InputFormatException inpForExc)
makes an instance of OptimizationIni, and returns the objective function delimiters
|
private void |
instantiateOptimizationSettings_ResultChecker(java.io.StreamTokenizer optComStrTok,
InputFormatException inpForExc,
java.lang.String fn,
int maxEqualResults)
makes an instance of OptimizationSettings and ResultChecker
|
private void |
instantiateResultManager(InputFormatException inpForExc)
makes an instance of ResultManager
|
(package private) void |
instantiateSimulationStarter(java.io.StreamTokenizer optCfgStrTok,
InputFormatException inpForExc,
java.lang.String fn)
makes an instance of SimulationStarter
|
boolean |
isDebug()
checks whether we should run in debug mode
|
static void |
main(java.lang.String[] args)
Main routine
|
boolean |
mustStopOptimization()
returns a flag whether GenOpt must be stopped after the current simulation
|
private static boolean |
parseBoolean(java.io.StreamTokenizer st,
java.lang.String keyWord,
java.lang.String value,
InputFormatException inpForExc,
java.lang.String fileName)
parses a String to a boolean an writes error into the InputFormatException
|
private static ContinuousParameter |
parseContinuousPar(java.lang.String[] val,
InputFormatException e,
int lineNumber,
java.lang.String fileName)
gets a new instance of a ContinuousParameter Object based on the value in 'val'.
|
private static DiscreteParameter |
parseDiscretePar(java.io.StreamTokenizer optComStrTok,
java.lang.String[] key,
java.lang.String[] val,
InputFormatException inpForExc,
java.lang.String fileName)
gets a new instance of a DiscreteParameter Object.
|
private static double |
parseDouble(java.io.StreamTokenizer st,
java.lang.String keyWord,
java.lang.String value,
double minVal,
double maxVal,
InputFormatException inpForExc,
java.lang.String fileName)
parses a String to a double and writes error into the InputFormatException
|
private static double |
parseDouble(java.io.StreamTokenizer st,
java.lang.String variableName,
java.lang.String keyWord,
java.lang.String value,
double minVal,
double maxVal,
InputFormatException inpForExc,
java.lang.String fileName)
parses a String to a double and writes error into the InputFormatException
|
private static int |
parseInteger(java.io.StreamTokenizer st,
java.lang.String keyWord,
java.lang.String value,
int minVal,
int maxVal,
InputFormatException inpForExc,
java.lang.String fileName)
parses a String to an int and writes error into the InputFormatException
|
private static int |
parseInteger(java.io.StreamTokenizer st,
java.lang.String variableName,
java.lang.String keyWord,
java.lang.String value,
int minVal,
int maxVal,
InputFormatException inpForExc,
java.lang.String fileName)
parses a String to an int and writes error into the InputFormatException
|
void |
print(java.lang.String text)
prints a message to the output device without finishing the line
|
void |
printError(java.lang.String text)
prints an error to the output device
|
void |
println(java.lang.String text)
prints a message to the output device, and then finishs the line
|
static void |
printStackTrace(java.lang.Throwable t)
prints a stackTrace to the output and error stream
|
void |
run()
runs the optimization method
|
void |
setNewTrial()
reports a new optimization trial to the GUI
|
private void |
setupProperties()
sets up the properties
|
private static void |
setWrongClassTypeInputFormatException(java.io.StreamTokenizer st,
java.lang.String keyWord,
java.lang.String value,
InputFormatException inpForExc,
java.lang.Object wrapperClass,
java.lang.String fileName)
sets an error message in the InputFormatException instance indicating that a wrong
data type has been received
|
void |
sleepGenOpt(boolean susp)
suspends GenOpt if
susp is true , otherwise
resume GenOpt |
void |
stopOptimization()
forces GenOpt to stop the optimization after the current simulation
|
void |
writeLogFile()
writes the log file
GenOpt.log to
the log directory. |
void |
writeLogFile(java.lang.String errorMessage)
writes the log file
GenOpt.log to
the log directory. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private static final java.lang.String LS
public static final java.lang.String VERSION_NUMBER
VERSION_NUMBER
here.public static final java.lang.String VERSION_ID
VERSION_ID
here.public static final java.lang.String VERSION
VERSION
here.public static final java.lang.String COPYRIGHT
COPYRIGHT
here.public static final java.lang.String AUTHOR
AUTHOR
here.public static final java.lang.String ACKNOWLEDGMENT
ACKNOWLEDGMENT
here.public static final java.lang.String VERSIONINFO
public static final java.lang.String PROGRAMINFO
public static final java.lang.String DIVIDER
public static final java.lang.String RUNHEADER
RUNHEADER
here.public static final java.lang.String USER_STOP_MESSAGE
public static boolean DEBUG
public static final java.lang.String DEBUG_WARNING
public java.lang.String USERDIR
protected WinGenOpt wgo
protected int dimCon
protected int dimDis
protected int dimInpFun
public WarningManager warMan
public InfoManager infMan
public ContinuousParameter[] conPar
public DiscreteParameter[] disPar
public InputFunction[] inpFun
public OptimizationIni OptIni
public OptimizationSettings OptSet
public IOSettings ioSet
public SimulationStarter SimSta
public ErrorChecker ErrChe
public ResultManager ResMan
public ResultChecker resChe
private java.lang.String maiAlg
protected java.util.Date startDate
private java.lang.String optIniPat
private java.lang.String optIniFilNam
private static int exiFla
private static boolean stopGenOpt
private static volatile boolean suspend
private Preference pref
public GenOpt()
public GenOpt(java.lang.String optIniFileName, InputFormatException inpForExc, WinGenOpt windowVersion) throws java.io.FileNotFoundException, java.io.IOException
optIniFileName
- a String
valueinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectwindowVersion
- reference to WinGenOpt Object or null
pointerjava.io.FileNotFoundException
java.io.IOException
public static javax.swing.JFileChooser getInitializationFileChooser(java.io.File IniStartUpFile)
IniStartUpFile
- a File
valueJFileChooser
valueprotected java.io.File getIniStartUpFile()
private void initializeOptimizationIniName(java.lang.String optIniFileName) throws java.io.IOException
optIniFileName
- name of optimization ini file or null pointerjava.io.IOException
- If an I/O error occurs, which is possible because the construction of the
canonical pathname may require filesystem queriesprivate OrderedMap instantiateOptimizationIni(InputFormatException inpForExc) throws java.io.FileNotFoundException, java.io.IOException
inpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectOrderedMap
of the form [[Name1, Delimiter1]
, ... , [NameN, DelimiterN]]
if present or a null pointer otherwisejava.io.FileNotFoundException
java.io.IOException
- If the canonical path of the user directory cannot be obtainedprivate OrderedMap getObjectiveFunctionDelimiter(java.io.StreamTokenizer st, InputFormatException ife, java.lang.String fn) throws java.io.IOException
st
- StreamTokenizer where pointer is set before the section startife
- refernce to InputFormatException. InputFormatException will be
written in this Objectfn
- associated file name. Used for error report onlyjava.io.IOException
private void instantiateErrChe_SimSta(InputFormatException inpForExc) throws java.io.FileNotFoundException
inpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectjava.io.FileNotFoundException
private java.lang.String[] getMultipleStringPairs(java.lang.String[] keys, boolean[] required, java.io.StreamTokenizer st, InputFormatException ife, java.lang.String fn)
keys
pair in a string array. The order of
the keys in the file is arbitrary.keys
- a pair of Strings where each String is a keyword for the entry
to be readrequired
- true
if key must be specified, false
if key
is optionalst
- StreamTokenizer from which will be readife
- reference to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of file that is being read[val1(key[1]), val1(key[2]), val2(key[1]), ....]
.
If a key is not required and was not specified, then the current
element is set to null
private void instantiateErrorChecker(java.io.StreamTokenizer optCfgStrTok, InputFormatException inpForExc, java.lang.String fn)
optCfgStrTok
- StreamTokenizer of the optimization configuration fileinpForExc
- reference to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization configuration fileprivate void instantiateIOSettings(java.io.StreamTokenizer optCfgStrTok, InputFormatException inpForExc, java.lang.String fn)
optCfgStrTok
- StreamTokenizer of the optimization configuration fileinpForExc
- reference to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization configuration filevoid instantiateSimulationStarter(java.io.StreamTokenizer optCfgStrTok, InputFormatException inpForExc, java.lang.String fn)
optCfgStrTok
- StreamTokenizer of the optimization configuration fileinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization configuration fileprivate void instantiateFreePar_OptSet_ResChe_maiAlg(InputFormatException inpForExc, int maxEqualResults) throws java.io.FileNotFoundException, java.io.IOException
inpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectmaxEqualResults
- default value for maximum number of equal result
before GenOpt terminates with an errorjava.io.FileNotFoundException
java.io.IOException
private void instantiateFreePar(java.io.StreamTokenizer optComStrTok, InputFormatException inpForExc, java.lang.String fn)
optComStrTok
- StreamTokenizer of the optimization command fileinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization command fileprivate void getFunctionInput(java.io.StreamTokenizer optComStrTok, InputFormatException inpForExc, java.lang.String fn)
optComStrTok
- StreamTokenizer of the optimization command fileinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization command fileprivate void getParameterInput(java.io.StreamTokenizer optComStrTok, InputFormatException inpForExc, java.lang.String fn)
optComStrTok
- StreamTokenizer of the optimization command fileinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization command fileprivate void instantiateOptimizationSettings_ResultChecker(java.io.StreamTokenizer optComStrTok, InputFormatException inpForExc, java.lang.String fn, int maxEqualResults)
optComStrTok
- StreamTokenizer of the optimization command fileinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectfn
- file name (including path) of optimization command filemaxEqualResults
- default value for maximum number of equal result
before GenOpt terminates with an errorprivate static boolean parseBoolean(java.io.StreamTokenizer st, java.lang.String keyWord, java.lang.String value, InputFormatException inpForExc, java.lang.String fileName)
st
- the StreamTokenizerkeyWord
- the keyWord associated with the value val
value
- the value received for keyWord
inpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectfileName
- name of the file where input comes fromprivate static int parseInteger(java.io.StreamTokenizer st, java.lang.String keyWord, java.lang.String value, int minVal, int maxVal, InputFormatException inpForExc, java.lang.String fileName)
st
- the StreamTokenizerkeyWord
- the keyWord associated with the value val
value
- the value received for keyWord
minVal
- minimal allowed valuemaxVal
- maximal allowed valueinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectfileName
- name of the file where input comes fromint
value of val
private static int parseInteger(java.io.StreamTokenizer st, java.lang.String variableName, java.lang.String keyWord, java.lang.String value, int minVal, int maxVal, InputFormatException inpForExc, java.lang.String fileName)
st
- the StreamTokenizervariableName
- the variable name associated with the value val
keyWord
- the keyWord associated with the value val
value
- the value received for keyWord
minVal
- minimal allowed valuemaxVal
- maximal allowed valueinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectfileName
- name of the file where input comes fromint
value of val
private static double parseDouble(java.io.StreamTokenizer st, java.lang.String variableName, java.lang.String keyWord, java.lang.String value, double minVal, double maxVal, InputFormatException inpForExc, java.lang.String fileName)
st
- the StreamTokenizervariableName
- the variable name associated with the value val
keyWord
- the keyWord associated with the value val
value
- the value received for keyWord
minVal
- minimal allowed valuemaxVal
- maximal allowed valueinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectfileName
- name of the file where input comes fromdouble
value of val
private static double parseDouble(java.io.StreamTokenizer st, java.lang.String keyWord, java.lang.String value, double minVal, double maxVal, InputFormatException inpForExc, java.lang.String fileName)
st
- the StreamTokenizerkeyWord
- the keyWord associated with the value val
value
- the value received for keyWord
minVal
- minimal allowed valuemaxVal
- maximal allowed valueinpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectfileName
- name of the file where input comes fromprivate static void setWrongClassTypeInputFormatException(java.io.StreamTokenizer st, java.lang.String keyWord, java.lang.String value, InputFormatException inpForExc, java.lang.Object wrapperClass, java.lang.String fileName)
st
- the StreamTokenizerkeyWord
- the keyWord associated with the value val
value
- the value received for keyWord
inpForExc
- refernce to InputFormatException. InputFormatException will be
written in this ObjectwrapperClass
- any of the wrapper class of the primitive Java typefileName
- name of the file where input comes fromprivate void instantiateResultManager(InputFormatException inpForExc)
inpForExc
- refernce to InputFormatException. InputFormatException will be
written in this Objectprivate static ContinuousParameter parseContinuousPar(java.lang.String[] val, InputFormatException e, int lineNumber, java.lang.String fileName)
val
- String array with following elements:
val[0] = Name; val[1] = Min ; val[2] = Ini;
val[3] = Max ; val[4] = Step;
e
- reference to InputFormatException. Error messages are written into
this ObjectlineNumber
- line number to which the error report will be referred tofileName
- name of file (for error report only) or null
pointerprivate static DiscreteParameter parseDiscretePar(java.io.StreamTokenizer optComStrTok, java.lang.String[] key, java.lang.String[] val, InputFormatException inpForExc, java.lang.String fileName)
optComStrTok
- StreamTokenizer of the optimization command filekey
- String array with the keywords:
key[0] = Name; key[1] = Min ; key[2] = Ini;
key[3] = Max ; key[4] = Step; key[5] = Type;
key[6] = Values;
val
- String array the values for key
inpForExc
- reference to InputFormatException. Error messages are written into
this ObjectfileName
- name of file (for error report only)public java.lang.String getMainAlgorithm()
String
valuepublic java.io.StreamTokenizer getAlgorithmSection() throws InputFormatException, java.io.IOException
Algorithm
sectionStreamTokenizer
valueInputFormatException
java.io.IOException
public java.io.StreamTokenizer getAlgorithmSection(InputFormatException e) throws java.io.IOException
Algorithm
sectione
- reference to InputFormatException. Error messages are written into
this ObjectStreamTokenizer
valuejava.io.IOException
public void writeLogFile(java.lang.String errorMessage)
GenOpt.log
to
the log directory.errorMessage
- the error messagepublic void writeLogFile()
GenOpt.log
to
the log directory.private void flushLogFile(java.lang.String content)
GenOpt.log
to
the log directory.content
- the content of the filepublic java.io.File getOptimizationIniFile()
protected java.lang.String getRunInfo()
public java.lang.String getRuntime(java.util.Date now)
xhh:mm:ss
now
- a Date
valuepublic java.util.Date getStartDate()
public void setNewTrial()
public void print(java.lang.String text)
text
- the text to be printedpublic void println(java.lang.String text)
text
- the text to be printedpublic void printError(java.lang.String text)
text
- the text to be printedpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stopOptimization()
public void sleepGenOpt(boolean susp)
susp
is true
, otherwise
resume GenOptsusp
- a boolean
valuepublic boolean mustStopOptimization()
true
if GenOpt has to be stopped, false
otherwisepublic int getDimensionContinuous()
public int getDimensionDiscrete()
private Optimizer getOptimizer() throws java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, InputFormatException, java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
InputFormatException
java.io.IOException
public int getExitFlag()
public static void printStackTrace(java.lang.Throwable t)
t
- Throwableprivate void setupProperties()
public java.lang.String getSeparator()
public boolean isDebug()
true
if we run in debug mode, false
otherwisepublic static void main(java.lang.String[] args)
args
- optional parameter for optimization initialization file