public class ResultChecker
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 | Field and Description |
|---|---|
private int |
ARRAYINCREMENT
Constant for increasing the array size
|
private int |
arrSiz
current size of array
|
private int[] |
cou
array with the counter of equal results
|
private double[] |
f
array with the objective function values, sorted with highest value at the
0-th position
|
private static java.lang.String |
LS
System dependent line separator
|
private int |
matVal
counter for number of matching values.
|
private int |
maxMatVal
maximum allowed number of matching values
|
private int[] |
num
array with the run number, sorted with highest value at the
0-th position
|
private int |
numMatVal
counter for total number of matching values.
|
private int |
resNum
number of results, starting with 0
|
| Constructor and Description |
|---|
ResultChecker(int maxNumberOfMatchingResults)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
check()
checks whether the maximum number of matching results is reached.
|
private int[] |
getMatchingNumbers()
gets an array with the indices of all matching numbers
|
int |
getNumberOfMatchingResults()
gets the total number of matching results
|
private void |
increaseArraySize()
increases the array size
|
void |
setNewTrial(double functionValue,
int runNumber)
sets a new trial
|
void |
setNumberOfMatchingResults(int maxNumberOfMatchingResults)
sets the maximal allowed number of matching results
|
private void |
setRun(double functionValue,
int runNumber)
sets the new trial
|
private static final java.lang.String LS
private final int ARRAYINCREMENT
private double[] f
private int[] num
private int[] cou
private int arrSiz
private int resNum
private int matVal
private int numMatVal
private int maxMatVal
public ResultChecker(int maxNumberOfMatchingResults)
maxNumberOfMatchingResults - number how many results can be
equal without an OptimizerException is thrownpublic void setNewTrial(double functionValue,
int runNumber)
functionValue - value of the objective functionrunNumber - the number of the optimization runpublic void check()
throws OptimizerException
OptimizerException - thrown if the maximum number
of equal results is reachedpublic void setNumberOfMatchingResults(int maxNumberOfMatchingResults)
maxNumberOfMatchingResults - number how many results can be
equal without an OptimizerException is thrownpublic int getNumberOfMatchingResults()
private int[] getMatchingNumbers()
private void increaseArraySize()
private void setRun(double functionValue,
int runNumber)
functionValue - value of the objective functionrunNumber - the number of the optimization run