public class ResultManager
extends java.lang.Object
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 | Class and Description |
---|---|
protected class |
ResultManager.ResultPoint
inner class with result point
|
Modifier and Type | Field and Description |
---|---|
protected ContinuousParameter[] |
conPar
array with all continuous, free parameters
|
protected int |
dimCon
number of continuous, free parameters
|
protected int |
dimDis
number of discrete, free parameters
|
protected int |
dimF
number of function values
|
protected DiscreteParameter[] |
disPar
array with all discrete, free parameters
|
protected GenOpt |
go
reference to GenOpt object
|
private static java.lang.String |
LS
System dependent line separator
|
protected int |
maiIteNum
number of the main iteration
|
protected java.lang.String[] |
nameF
function names
|
protected java.lang.String[] |
outFilNam
name (including path) of output files
|
private static java.lang.String[] |
OUTFILNAM
Name of output file with main iteration steps only
|
protected java.lang.String |
outFilPat
path of the output files
|
protected java.util.LinkedList<ResultManager.ResultPoint> |
ptsMai
list with results of the main interation
|
protected java.util.LinkedList<ResultManager.ResultPoint> |
ptsSub
list with results of the main interation
|
protected int |
resNum
number of result entry of all and sub iterations, starting with 0
|
protected static int |
simNum
number of function evaluations
|
protected int |
subIteNum
number of the sub iteration
|
Constructor and Description |
---|
ResultManager(GenOpt GenOptRef,
java.lang.String outputFilePath,
java.lang.String outputFileHeader,
java.lang.String[] functionNames,
ContinuousParameter[] cPar,
DiscreteParameter[] dPar) |
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.String s)
appends a String to the output listing files
|
double |
getAbsDifMaiObjFunVal()
Gets the absolute difference of the last objective function value and
the second last objective function value (but not the absolute value
of the difference) where both are values of the a main iteration
|
Point[] |
getAllPoint(int numberOfValues)
Gets an array with the points of all iteration steps
(including subiterations).
|
int |
getDimensionContinuous()
gets the number of continuous, free parameters
|
int |
getDimensionDiscrete()
gets the number of discrete, free parameters
|
int |
getDimensionF()
gets the number of function values
|
Point |
getMinimumPoint()
Gets the point with the lowest objective function value of the main iterations
|
int |
getMinimumPointSimulationNumber()
Gets the run number with the lowest objective function value of the main iterations
|
protected ResultManager.ResultPoint |
getMinimumResultPoint()
Gets the ResultPoint with the lowest objective function value
of the main iterations with the highest step number.
|
java.lang.String[] |
getNameContinuousAndDiscrete()
gets the names of the variables
|
java.lang.String[] |
getNameF()
gets the names of the function values
|
int |
getNumberOfAllResults()
Returns the number of all results
|
int |
getNumberOfMaiIteration()
Returns the number of the main iterations
|
static int |
getNumberOfSimulation()
Returns the number of simulations
|
double |
getRelDifMaiObjFunVal()
Gets the relative difference of the last objective function value and
the second last objective function value where both are values of
a main iteration
|
int |
getSimulationNumber()
gets the run number
|
static void |
increaseNumberOfFunctionEvaluation()
Increases the number of function evaluations
|
private void |
increaseResultNumber(int runIde)
Increases the number of the result entry, sets the number of the main
and the sub iteration and writes the output to the text files.
|
private void |
printPoint(ResultManager.ResultPoint rp,
int runIde)
Prints a ResultPoint to the output file
|
void |
reportMinimum(java.lang.String comment)
Reports the minimum point to the output files
|
void |
resetResultNumber()
Resets the counter of the main and sub iterations to 1.
|
void |
setNewTrial(Point x,
int runIde)
Sets the new point
|
private static final java.lang.String LS
private static final java.lang.String[] OUTFILNAM
protected GenOpt go
protected ContinuousParameter[] conPar
protected DiscreteParameter[] disPar
protected java.util.LinkedList<ResultManager.ResultPoint> ptsMai
protected java.util.LinkedList<ResultManager.ResultPoint> ptsSub
protected int dimCon
protected int dimDis
protected int dimF
protected java.lang.String[] nameF
protected java.lang.String outFilPat
protected java.lang.String[] outFilNam
protected int resNum
protected static int simNum
protected int maiIteNum
protected int subIteNum
public ResultManager(GenOpt GenOptRef, java.lang.String outputFilePath, java.lang.String outputFileHeader, java.lang.String[] functionNames, ContinuousParameter[] cPar, DiscreteParameter[] dPar) throws java.io.IOException
GenOptRef
- reference to GenOpt objectoutputFilePath
- path of the output fileoutputFileHeader
- header to be written to the output filefunctionNames
- Array of String where each String holds the name of
a function valuecPar
- array containing the continuous parametersdPar
- array containing the discrete parametersjava.io.IOException
public void append(java.lang.String s) throws java.io.IOException
s
- String to be appended to output listing filesjava.io.IOException
public static void increaseNumberOfFunctionEvaluation()
public void resetResultNumber()
private void increaseResultNumber(int runIde)
runIde
- 0
if main iteration, 1
if
sub iterationpublic void setNewTrial(Point x, int runIde) throws java.io.IOException
x
- Point to be reportedrunIde
- 0
if main iteration,
1
if sub iterationjava.io.IOException
public static int getNumberOfSimulation()
public int getNumberOfAllResults()
public int getNumberOfMaiIteration()
public Point[] getAllPoint(int numberOfValues)
numberOfValues
- number of iteration steps of which the datas
are wanted, counting backwards from the current
iteration steppublic void reportMinimum(java.lang.String comment) throws java.io.IOException
java.io.IOException
private void printPoint(ResultManager.ResultPoint rp, int runIde) throws java.io.IOException
rp
- ResultPoint to be printedrunIde
- 0
if main iteration, 1
if
sub iterationjava.io.IOException
public Point getMinimumPoint()
public int getMinimumPointSimulationNumber()
protected ResultManager.ResultPoint getMinimumResultPoint()
public double getAbsDifMaiObjFunVal()
public double getRelDifMaiObjFunVal()
public java.lang.String[] getNameContinuousAndDiscrete()
public java.lang.String[] getNameF()
public int getDimensionContinuous()
public int getDimensionDiscrete()
public int getDimensionF()
public int getSimulationNumber()