Hide stats field and use parameter annotation.

This commit is contained in:
Fabian Becker 2014-11-13 11:06:32 +01:00
parent a2ddf25ce6
commit 83194f4d04
4 changed files with 11 additions and 31 deletions

View File

@ -80,10 +80,8 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
protected int optRunsPerformed;
protected double[] currentBestFit;
protected double[] currentBestFeasibleFit;
// protected double[] meanBestFeasibleFit;
protected double[] currentMeanFit;
protected double[] currentWorstFit;
// protected double[] meanBestOfRunFitness;
protected double currentAvgEucDistInPop, currentMaxEucDistInPop;
protected double currentAvgPopDistMetric, currentMaxPopDistMetric;
protected IndividualInterface bestCurrentIndy, bestOfRunIndy, bestOfRunFeasibleIndy, bestFeasibleAllRuns, bestIndyAllRuns;
@ -166,14 +164,10 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
if (dataListeners != null) {
for (InterfaceStatisticsListener l : dataListeners) {
if (start) {
l.notifyRunStarted(runNumber, statisticsParameter.getMultiRuns(),
currentStatHeader, currentStatMetaInfo);
l.notifyRunStarted(runNumber, statisticsParameter.getMultiRuns(), currentStatHeader, currentStatMetaInfo);
} else {
l.notifyRunStopped(optRunsPerformed, normal);
// if (optRunsPerformed > 1) {
l.finalMultiRunResults(currentStatHeader,
finalObjectData);
// }
l.finalMultiRunResults(currentStatHeader, finalObjectData);
}
}
}
@ -351,9 +345,6 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
if (printRunStoppedVerbosity()) {
printIndy("Run best", bestOfRunIndy);
}
// if (meanBestOfRunFitness==null) {
// meanBestOfRunFitness=bestRunIndividual.getFitness().clone();
// } else addSecond(meanBestOfRunFitness, bestRunIndividual.getFitness());
}
if (feasibleFoundAfter > 0) {
if (printRunStoppedVerbosity()) {

View File

@ -3,6 +3,7 @@ package eva2.optimization.statistics;
import eva2.optimization.enums.StatisticsOnSingleDataSet;
import eva2.optimization.enums.StatisticsOnTwoSampledData;
import eva2.tools.StringSelection;
import eva2.util.annotation.Parameter;
import javax.swing.*;
import java.io.Serializable;
@ -23,26 +24,20 @@ public class StatisticalEvaluationParameters implements Serializable {
return twoSampledStats;
}
@Parameter(description = "Statistical tests on two-sampled data")
public void setTwoSampledStats(StringSelection twoSStats) {
this.twoSampledStats = twoSStats;
}
public String twoSampledStatsTipText() {
return "Statistical tests on two-sampled data";
}
public StringSelection getOneSampledStats() {
return singleStats;
}
@Parameter(description = "Statistical tests on one-sampled data")
public void setOneSampledStats(StringSelection singleStats) {
this.singleStats = singleStats;
}
public String oneSampledStatsTipText() {
return "Statistical tests on one-sampled data";
}
public String getName() {
return "Statistical evaluation parameters";
}

View File

@ -8,6 +8,7 @@ import eva2.tools.EVAERROR;
import eva2.tools.Serializer;
import eva2.tools.StringSelection;
import eva2.util.annotation.Description;
import eva2.util.annotation.Hidden;
import eva2.util.annotation.Parameter;
import java.io.FileInputStream;
@ -194,6 +195,7 @@ public class StatisticsParameters implements InterfaceStatisticsParameters, Inte
}
@Override
@Hidden
public void setShowTextOutput(boolean show) {
// activate if not activated
if (show && outputTo == OutputTo.FILE) {

View File

@ -12,6 +12,7 @@ import eva2.problems.AbstractProblemDouble;
import eva2.problems.InterfaceOptimizationProblem;
import eva2.tools.math.Mathematics;
import eva2.util.annotation.Description;
import eva2.util.annotation.Parameter;
import java.io.Serializable;
@ -271,6 +272,7 @@ public class NelderMeadSimplex extends AbstractOptimizer implements Serializable
/**
* @param populationSize the populationSize to set
*/
@Parameter(description = "The population size should be adapted to the dimensions of the problem (e.g. n+1)")
public void setPopulationSize(int populationSize) {
this.populationSize = populationSize;
if (population != null) {
@ -279,10 +281,6 @@ public class NelderMeadSimplex extends AbstractOptimizer implements Serializable
}
}
public String populationSizeTipText() {
return "The population size should be adapted to the dimensions of the problem (e.g. n+1)";
}
@Override
public void registerPopulationStateChanged(Object source, String name) {
if (name.compareTo(Population.FUN_CALL_INTERVAL_REACHED) == 0) {
@ -416,23 +414,17 @@ public class NelderMeadSimplex extends AbstractOptimizer implements Serializable
return checkConstraints;
}
@Parameter(description = "Mark to check range constraints by reflection/projection")
public void setCheckRange(boolean checkRange) {
this.checkConstraints = checkRange;
}
public String checkRangeTipText() {
return "Mark to check range constraints by reflection/projection";
}
public int getCritIndex() {
return fitIndex;
}
@Parameter(description = "For multi-criterial problems, set the index of the fitness to be used in 0..n-1. Default is 0")
public void setCritIndex(int fitIndex) {
this.fitIndex = fitIndex;
}
public String critIndexTipText() {
return "For multi-criterial problems, set the index of the fitness to be used in 0..n-1. Default is 0";
}
}