Complete Yaml output for CLI mode.
Cleanup of AbstractStatistics
This commit is contained in:
parent
2e1f862718
commit
553002c834
@ -13,15 +13,13 @@ import eva2.optimization.statistics.InterfaceTextListener;
|
|||||||
import eva2.optimization.strategies.InterfaceOptimizer;
|
import eva2.optimization.strategies.InterfaceOptimizer;
|
||||||
import eva2.problems.InterfaceAdditionalPopulationInformer;
|
import eva2.problems.InterfaceAdditionalPopulationInformer;
|
||||||
import eva2.problems.InterfaceOptimizationProblem;
|
import eva2.problems.InterfaceOptimizationProblem;
|
||||||
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -38,35 +36,38 @@ public class Main {
|
|||||||
|
|
||||||
LinkedHashMap<String, Object> optimizationLog = new LinkedHashMap<>();
|
LinkedHashMap<String, Object> optimizationLog = new LinkedHashMap<>();
|
||||||
// Meta parameters
|
// Meta parameters
|
||||||
optimizationLog.put("population_size", parameters.getOptimizer().getPopulation().getTargetSize());
|
optimizationLog.put("populationSize", parameters.getOptimizer().getPopulation().getTargetSize());
|
||||||
optimizationLog.put("number_of_runs", statisticsParameters.getMultiRuns());
|
optimizationLog.put("numberOfRuns", statisticsParameters.getMultiRuns());
|
||||||
optimizationLog.put("seed", parameters.getRandomSeed());
|
optimizationLog.put("seed", parameters.getRandomSeed());
|
||||||
|
|
||||||
// Container for individual runs
|
YamlStatistics yamlStatistics = new YamlStatistics(statisticsParameters);
|
||||||
List<LinkedHashMap<String, Object>> runs = new ArrayList<>();
|
|
||||||
optimizationLog.put("runs", runs);
|
|
||||||
|
|
||||||
FileWriter fw;
|
/**
|
||||||
BufferedWriter bw = null;
|
* Runs optimization
|
||||||
try {
|
*/
|
||||||
fw = new FileWriter("derp.yml");
|
Processor optimizationProcessor = new Processor(yamlStatistics, parameters);
|
||||||
bw = new BufferedWriter(fw);
|
|
||||||
} catch (IOException ex) {
|
|
||||||
System.out.println(ex.getMessage());
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Processor optimizationProcessor = new Processor(new YamlStatistics(statisticsParameters), parameters);
|
|
||||||
optimizationProcessor.setSaveParams(false);
|
optimizationProcessor.setSaveParams(false);
|
||||||
optimizationProcessor.startOptimization();
|
optimizationProcessor.startOptimization();
|
||||||
|
|
||||||
|
|
||||||
optimizationProcessor.runOptimizationOnce();
|
optimizationProcessor.runOptimizationOnce();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get run statistics
|
||||||
|
*/
|
||||||
|
optimizationLog.put("runs", yamlStatistics.getRuns());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Yaml configuration
|
||||||
|
*/
|
||||||
|
DumperOptions options = new DumperOptions();
|
||||||
|
options.setExplicitStart(true);
|
||||||
|
options.setExplicitEnd(true);
|
||||||
|
Yaml yaml = new Yaml();
|
||||||
|
|
||||||
|
System.out.println(yaml.dump(optimizationLog));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final class YamlStatistics implements InterfaceStatistics {
|
final class YamlStatistics implements InterfaceStatistics {
|
||||||
private static final Logger LOGGER = Logger.getLogger(YamlStatistics.class.getName());
|
|
||||||
private InterfaceStatisticsParameters statisticsParameters;
|
private InterfaceStatisticsParameters statisticsParameters;
|
||||||
private List<LinkedHashMap<String, Object>> runs;
|
private List<LinkedHashMap<String, Object>> runs;
|
||||||
private LinkedHashMap<String, Object> currentRun;
|
private LinkedHashMap<String, Object> currentRun;
|
||||||
@ -127,10 +128,10 @@ final class YamlStatistics implements InterfaceStatistics {
|
|||||||
@Override
|
@Override
|
||||||
public void createNextGenerationPerformed(PopulationInterface pop, InterfaceOptimizer opt, List<InterfaceAdditionalPopulationInformer> informerList) {
|
public void createNextGenerationPerformed(PopulationInterface pop, InterfaceOptimizer opt, List<InterfaceAdditionalPopulationInformer> informerList) {
|
||||||
LinkedHashMap<String, Object> generation = new LinkedHashMap<>();
|
LinkedHashMap<String, Object> generation = new LinkedHashMap<>();
|
||||||
generation.put("bestFitness", pop.getBestFitness());
|
|
||||||
generation.put("meanFitness", pop.getMeanFitness());
|
|
||||||
generation.put("functionCalls", pop.getFunctionCalls());
|
|
||||||
generation.put("generation", currentGeneration);
|
generation.put("generation", currentGeneration);
|
||||||
|
generation.put("bestFitness", pop.getBestFitness().clone());
|
||||||
|
generation.put("meanFitness", pop.getMeanFitness().clone());
|
||||||
|
generation.put("functionCalls", pop.getFunctionCalls());
|
||||||
this.currentGenerations.add(generation);
|
this.currentGenerations.add(generation);
|
||||||
this.currentGeneration++;
|
this.currentGeneration++;
|
||||||
}
|
}
|
||||||
@ -159,4 +160,8 @@ final class YamlStatistics implements InterfaceStatistics {
|
|||||||
public void postProcessingPerformed(Population resultPop) {
|
public void postProcessingPerformed(Population resultPop) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<LinkedHashMap<String, Object>> getRuns() {
|
||||||
|
return this.runs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@ import java.io.PrintWriter;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CopyOnWriteArraySet;
|
import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract class handling statistics. Most important stuff happens in startOptimizationPerformed, stopOptimizationPerformed
|
* An abstract class handling statistics. Most important stuff happens in startOptimizationPerformed, stopOptimizationPerformed
|
||||||
@ -43,6 +45,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
|||||||
* Listeners implementing InterfaceStatisticsListener receive the raw data per iteration.
|
* Listeners implementing InterfaceStatisticsListener receive the raw data per iteration.
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractStatistics implements InterfaceTextListener, InterfaceStatistics {
|
public abstract class AbstractStatistics implements InterfaceTextListener, InterfaceStatistics {
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(AbstractStatistics.class.getName());
|
||||||
private transient PrintWriter resultOut;
|
private transient PrintWriter resultOut;
|
||||||
protected InterfaceStatisticsParameters statisticsParameter;
|
protected InterfaceStatisticsParameters statisticsParameter;
|
||||||
|
|
||||||
@ -181,14 +184,13 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
/**
|
/**
|
||||||
* Collect start date and time of the run and if indicated, open a file output stream.
|
* Collect start date and time of the run and if indicated, open a file output stream.
|
||||||
*
|
*
|
||||||
* @param infoString
|
* @param infoString Info string for the optimization run
|
||||||
*/
|
*/
|
||||||
protected void initializeOutput(String infoString) {
|
protected void initializeOutput(String infoString) {
|
||||||
String startDate = getDateString();
|
String startDate = getDateString();
|
||||||
// open the result file:
|
// open the result file:
|
||||||
if (doFileOutput() // not "text-window only"
|
if (doFileOutput() // not "text-window only"
|
||||||
&& (statisticsParameter.getOutputVerbosity() != InterfaceStatisticsParameters.OutputVerbosity.NONE)) { // verbosity accordingly high
|
&& (statisticsParameter.getOutputVerbosity() != InterfaceStatisticsParameters.OutputVerbosity.NONE)) { // verbosity accordingly high
|
||||||
//!resFName.equalsIgnoreCase("none") && !resFName.equals("")) {
|
|
||||||
String fnameBase = makeOutputFileName(statisticsParameter.getResultFilePrefix(), infoString, startDate);
|
String fnameBase = makeOutputFileName(statisticsParameter.getResultFilePrefix(), infoString, startDate);
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
String fname = fnameBase;
|
String fname = fnameBase;
|
||||||
@ -199,10 +201,8 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
try {
|
try {
|
||||||
resultOut = new PrintWriter(new FileOutputStream(fname));
|
resultOut = new PrintWriter(new FileOutputStream(fname));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
LOGGER.log(Level.WARNING, "Error while opening log file", e);
|
||||||
System.out.println("Error: " + e);
|
|
||||||
}
|
}
|
||||||
resultOut.println("StartDate:" + startDate);
|
|
||||||
} else {
|
} else {
|
||||||
resultOut = null;
|
resultOut = null;
|
||||||
}
|
}
|
||||||
@ -211,10 +211,10 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
/**
|
/**
|
||||||
* Return a simple String describing the current date and time.
|
* Return a simple String describing the current date and time.
|
||||||
*
|
*
|
||||||
* @return
|
* @return A string containing current date and time
|
||||||
*/
|
*/
|
||||||
public static String getDateString() {
|
public static String getDateString() {
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("E'_'yyyy.MM.dd'_at_'HH.mm.ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
|
||||||
return formatter.format(new Date());
|
return formatter.format(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,14 +223,14 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String makeOutputFileName(String prefix, String infoString, String startDate) {
|
private String makeOutputFileName(String prefix, String infoString, String startDate) {
|
||||||
return (prefix + "_" + infoString).replace(' ', '_') + "_" + startDate + ".txt";
|
return (prefix + "_" + infoString).replace(' ', '_') + "_" + startDate + ".log";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to true, before every run the parameters will be stored to a file at the start
|
* If set to true, before every run the parameters will be stored to a file at the start
|
||||||
* of each run. Default is true.
|
* of each run. Default is true.
|
||||||
*
|
*
|
||||||
* @param doSave
|
* @param doSave Whether to save a serialized version of the optimization parameters or not.
|
||||||
*/
|
*/
|
||||||
public void setSaveParams(boolean doSave) {
|
public void setSaveParams(boolean doSave) {
|
||||||
saveParams = doSave;
|
saveParams = doSave;
|
||||||
@ -307,7 +307,7 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
@Override
|
@Override
|
||||||
public void stopOptimizationPerformed(boolean normal, String stopMessage) {
|
public void stopOptimizationPerformed(boolean normal, String stopMessage) {
|
||||||
if (lastSols == null) {
|
if (lastSols == null) {
|
||||||
System.err.println("WARNING, possibly there was no call to createNextGenerationPerformed before calling stopOptimizationPerformed (AbstractStatistics).");
|
LOGGER.warning("WARNING, possibly there was no call to createNextGenerationPerformed before calling stopOptimizationPerformed (AbstractStatistics).");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iterationCounter < sumDataCollection.size()) {
|
if (iterationCounter < sumDataCollection.size()) {
|
||||||
@ -377,9 +377,6 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
if (!printRunStoppedVerbosity() && printFinalVerbosity()) {
|
if (!printRunStoppedVerbosity() && printFinalVerbosity()) {
|
||||||
printToTextListener(".");
|
printToTextListener(".");
|
||||||
}
|
}
|
||||||
// if (currentBestFit!= null) {
|
|
||||||
// if (printRunStoppedVerbosity()) printToTextListener(" Best Fitness: " + BeanInspector.toString(currentBestFit) + "\n");
|
|
||||||
// }
|
|
||||||
fireDataListenersStartStop(optRunsPerformed, normal, false);
|
fireDataListenersStartStop(optRunsPerformed, normal, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,9 +403,6 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
private PopulationInterface makeStatsPop() {
|
private PopulationInterface makeStatsPop() {
|
||||||
Population pop = new Population(1);
|
Population pop = new Population(1);
|
||||||
|
|
||||||
// if (bestCurrentIndy!=null) pop.add(bestCurrentIndy);
|
|
||||||
// if (bestOfRunIndy!=null) pop.add(bestOfRunIndy);
|
|
||||||
// if (bestOfRunFeasibleIndy!=null) pop.add(bestOfRunFeasibleIndy);
|
|
||||||
if (bestIndyAllRuns != null) {
|
if (bestIndyAllRuns != null) {
|
||||||
pop.add(bestIndyAllRuns);
|
pop.add(bestIndyAllRuns);
|
||||||
}
|
}
|
||||||
@ -434,19 +428,19 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
/**
|
/**
|
||||||
* Calculate the mean fitness of final best individuals over the last series of multi-runs.
|
* Calculate the mean fitness of final best individuals over the last series of multi-runs.
|
||||||
*
|
*
|
||||||
* @return
|
* @return Mean fitness
|
||||||
*/
|
*/
|
||||||
public double[] getMeanBestFit(boolean requireFeasible) {
|
public double[] getMeanBestFitness(boolean requireFeasible) {
|
||||||
return calcMeanFit(requireFeasible ? runBestFeasibleList : runBestFitList);
|
return calculateMeanFitness(requireFeasible ? runBestFeasibleList : runBestFitList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the median fitness of final best individuals over the last series of multi-runs.
|
* Calculate the median fitness of final best individuals over the last series of multi-runs.
|
||||||
*
|
*
|
||||||
* @return
|
* @return Median fitness
|
||||||
*/
|
*/
|
||||||
public double[] getMedianBestFit(boolean requireFeasible) {
|
public double[] getMedianBestFitness(boolean requireFeasible) {
|
||||||
return calcMedianFit(requireFeasible ? runBestFeasibleList : runBestFitList);
|
return calculateMedianFitness(requireFeasible ? runBestFeasibleList : runBestFitList);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void finalizeOutput() {
|
protected void finalizeOutput() {
|
||||||
@ -476,7 +470,6 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
printToTextListener(textFieldDelimiter + (lastSum[i] / optRunsPerformed));
|
printToTextListener(textFieldDelimiter + (lastSum[i] / optRunsPerformed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (int i=0; i<lastAdditionalInfoSums.length; i++) if (lastAdditionalInfoSums[i]!=null) printToTextListener(" \t"+(lastAdditionalInfoSums[i]/optRunsPerformed));
|
|
||||||
printToTextListener("\n");
|
printToTextListener("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,25 +483,25 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
if (optRunsPerformed > 1) {
|
if (optRunsPerformed > 1) {
|
||||||
if (runBestFitList.size() > 0) {
|
if (runBestFitList.size() > 0) {
|
||||||
if (printFinalVerbosity()) {
|
if (printFinalVerbosity()) {
|
||||||
double[] meanBestFit = getMeanBestFit(false);
|
double[] meanBestFit = getMeanBestFitness(false);
|
||||||
printToTextListener(" MultiRun stats: Mean best fitness: " + BeanInspector.toString(meanBestFit) + "\n");
|
printToTextListener(" MultiRun stats: Mean best fitness: " + BeanInspector.toString(meanBestFit) + "\n");
|
||||||
if (meanBestFit.length == 1) {
|
if (meanBestFit.length == 1) {
|
||||||
printToTextListener(" MultiRun stats: Variance/Std.Dev.: " + BeanInspector.toString(calcStdDevVar(runBestFitList, meanBestFit[0])) + "\n");
|
printToTextListener(" MultiRun stats: Variance/Std.Dev.: " + BeanInspector.toString(calcStdDevVar(runBestFitList, meanBestFit[0])) + "\n");
|
||||||
}
|
}
|
||||||
printToTextListener(" MultiRun stats: Median best fitn.: " + BeanInspector.toString(getMedianBestFit(false)) + "\n");
|
printToTextListener(" MultiRun stats: Median best fitn.: " + BeanInspector.toString(getMedianBestFitness(false)) + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (printFinalVerbosity() && (bestFeasibleAllRuns != null)) {
|
if (printFinalVerbosity() && (bestFeasibleAllRuns != null)) {
|
||||||
printIndy("Overall best feasible", bestFeasibleAllRuns);
|
printIndy("Overall best feasible", bestFeasibleAllRuns);
|
||||||
}
|
}
|
||||||
if (runBestFeasibleList.size() > 0) { // always output feasible stats even if theyre equal
|
if (runBestFeasibleList.size() > 0) { // always output feasible stats even if they're equal
|
||||||
if (printFinalVerbosity()) {
|
if (printFinalVerbosity()) {
|
||||||
double[] meanBestFeasibleFit = getMeanBestFit(true);
|
double[] meanBestFeasibleFit = getMeanBestFitness(true);
|
||||||
printToTextListener(" MultiRun stats: Mean best feasible fitness (" + numOfRunsFeasibleFound + " runs): " + BeanInspector.toString(meanBestFeasibleFit) + "\n");
|
printToTextListener(" MultiRun stats: Mean best feasible fitness (" + numOfRunsFeasibleFound + " runs): " + BeanInspector.toString(meanBestFeasibleFit) + "\n");
|
||||||
if (meanBestFeasibleFit.length == 1) {
|
if (meanBestFeasibleFit.length == 1) {
|
||||||
printToTextListener(" MultiRun stats: Variance/Std.Dev.: " + BeanInspector.toString(calcStdDevVar(runBestFeasibleList, meanBestFeasibleFit[0])) + "\n");
|
printToTextListener(" MultiRun stats: Variance/Std.Dev.: " + BeanInspector.toString(calcStdDevVar(runBestFeasibleList, meanBestFeasibleFit[0])) + "\n");
|
||||||
}
|
}
|
||||||
printToTextListener(" MultiRun stats: Median best feasible fitn. (: " + numOfRunsFeasibleFound + " runs): " + BeanInspector.toString(getMedianBestFit(true)) + "\n");
|
printToTextListener(" MultiRun stats: Median best feasible fitn. (: " + numOfRunsFeasibleFound + " runs): " + BeanInspector.toString(getMedianBestFitness(true)) + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (refineMultiRuns && (sumDataCollection != null)) {
|
if (refineMultiRuns && (sumDataCollection != null)) {
|
||||||
@ -553,8 +546,7 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
|
|
||||||
private double[] calcStdDevVar(ArrayList<IndividualInterface> list, double meanFit) {
|
private double[] calcStdDevVar(ArrayList<IndividualInterface> list, double meanFit) {
|
||||||
double tmp, sum = 0;
|
double tmp, sum = 0;
|
||||||
for (Iterator<IndividualInterface> iter = list.iterator(); iter.hasNext(); ) {
|
for (IndividualInterface indy : list) {
|
||||||
IndividualInterface indy = iter.next();
|
|
||||||
tmp = indy.getFitness()[0] - meanFit;
|
tmp = indy.getFitness()[0] - meanFit;
|
||||||
sum += (tmp * tmp);
|
sum += (tmp * tmp);
|
||||||
}
|
}
|
||||||
@ -567,10 +559,10 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
/**
|
/**
|
||||||
* Calculate the mean fitness of a list of individuals.
|
* Calculate the mean fitness of a list of individuals.
|
||||||
*
|
*
|
||||||
* @param list
|
* @param list List of individuals
|
||||||
* @return
|
* @return Mean fitness of individuals in list
|
||||||
*/
|
*/
|
||||||
public static double[] calcMeanFit(List<IndividualInterface> list) {
|
public static double[] calculateMeanFitness(List<IndividualInterface> list) {
|
||||||
double[] sumFit = list.get(0).getFitness().clone();
|
double[] sumFit = list.get(0).getFitness().clone();
|
||||||
for (int i = 1; i < list.size(); i++) {
|
for (int i = 1; i < list.size(); i++) {
|
||||||
Mathematics.vvAdd(sumFit, list.get(i).getFitness(), sumFit);
|
Mathematics.vvAdd(sumFit, list.get(i).getFitness(), sumFit);
|
||||||
@ -580,10 +572,10 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
return sumFit;
|
return sumFit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double[] calcMedianFit(List<IndividualInterface> list) {
|
public static double[] calculateMedianFitness(List<IndividualInterface> list) {
|
||||||
ArrayList<double[]> dblAList = new ArrayList<>(list.size());
|
ArrayList<double[]> dblAList = new ArrayList<>(list.size());
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (IndividualInterface indy : list) {
|
||||||
dblAList.add(list.get(i).getFitness());
|
dblAList.add(indy.getFitness());
|
||||||
}
|
}
|
||||||
return Mathematics.median(dblAList, false);
|
return Mathematics.median(dblAList, false);
|
||||||
}
|
}
|
||||||
@ -631,13 +623,11 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////// InterfaceTextListener
|
|
||||||
@Override
|
@Override
|
||||||
public void print(String str) {
|
public void print(String str) {
|
||||||
printToTextListener(str);
|
printToTextListener(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////// InterfaceTextListener
|
|
||||||
@Override
|
@Override
|
||||||
public void println(String str) {
|
public void println(String str) {
|
||||||
printToTextListener(str);
|
printToTextListener(str);
|
||||||
@ -793,7 +783,6 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
|
|||||||
ret[0] = functionCalls;
|
ret[0] = functionCalls;
|
||||||
for (int i = 1; i <= selEnumVals.length; i++) {
|
for (int i = 1; i <= selEnumVals.length; i++) {
|
||||||
switch (selEnumVals[i - 1]) { // the field i+1 contains enum value i, because field 0 is reserved for the number of function calls
|
switch (selEnumVals[i - 1]) { // the field i+1 contains enum value i, because field 0 is reserved for the number of function calls
|
||||||
// currentBest, currentWorst, runBest, currentBestFeasible, runBestFeasible, avgPopDistance, maxPopDistance;
|
|
||||||
case currentBest:
|
case currentBest:
|
||||||
ret[i] = currentBestFit[defaultFitCriterion];
|
ret[i] = currentBestFit[defaultFitCriterion];
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user