Fixed comment fuckup where simple was replaced with eva2.problems.simple

Implements YamlStatistics in cli.Main
A few fixes in the processor to allow GUI-less optimization
This commit is contained in:
2014-11-13 17:49:40 +01:00
parent 3627d33df5
commit ca70b48bd2
62 changed files with 181 additions and 112 deletions

View File

@@ -572,7 +572,7 @@ public class OptimizerFactory {
} }
/** /**
* Return a eva2.problems.simple String showing the accessible optimizers. For external * Return a simple String showing the accessible optimizers. For external
* access." * access."
* *
* @return a String listing the accessible optimizers * @return a String listing the accessible optimizers
@@ -1303,7 +1303,7 @@ public class OptimizerFactory {
} }
/** /**
* Create a standard clustering hill climbing employing eva2.problems.simple ES mutation * Create a standard clustering hill climbing employing simple ES mutation
* with adaptive step size, starting in parallel 100 local searches and * with adaptive step size, starting in parallel 100 local searches and
* clustering intermediate populations to avoid optima being found several * clustering intermediate populations to avoid optima being found several
* times by the same population (density based clustering with sigma = * times by the same population (density based clustering with sigma =
@@ -1338,9 +1338,9 @@ public class OptimizerFactory {
} }
/** /**
* Create a custom clustering hillclimber using ES mutation (eva2.problems.simple or CMA) * Create a custom clustering hillclimber using ES mutation (simple or CMA)
* or nelder mead. The parameters hcInitialStep and hcStepThresh are only * or nelder mead. The parameters hcInitialStep and hcStepThresh are only
* relevant for the eva2.problems.simple mutation based hc method. * relevant for the simple mutation based hc method.
* *
* @param problem * @param problem
* @param evalCycle * @param evalCycle

View File

@@ -20,7 +20,7 @@ import java.util.BitSet;
/** /**
* This Runnable class just encapsulates the Processor class with some eva2.problems.simple ways to access a solution. * This Runnable class just encapsulates the Processor class with some simple ways to access a solution.
* *
* @author mkron * @author mkron
*/ */
@@ -255,7 +255,7 @@ public class OptimizerRunnable implements Runnable {
* @param vLev * @param vLev
*/ */
public void setVerbosityLevel(InterfaceStatisticsParameters.OutputVerbosity vLev) { public void setVerbosityLevel(InterfaceStatisticsParameters.OutputVerbosity vLev) {
proc.getStatistics().getStatisticsParameter().setOutputVerbosity(vLev); proc.getStatistics().getStatisticsParameters().setOutputVerbosity(vLev);
} }
/** /**
@@ -264,7 +264,7 @@ public class OptimizerRunnable implements Runnable {
* @param outp * @param outp
*/ */
public void setOutputTo(InterfaceStatisticsParameters.OutputTo outp) { public void setOutputTo(InterfaceStatisticsParameters.OutputTo outp) {
proc.getStatistics().getStatisticsParameter().setOutputTo(outp); proc.getStatistics().getStatisticsParameters().setOutputTo(outp);
} }
/** /**
@@ -273,7 +273,7 @@ public class OptimizerRunnable implements Runnable {
* @param multis * @param multis
*/ */
public void setMultiRuns(int multis) { public void setMultiRuns(int multis) {
proc.getStatistics().getStatisticsParameter().setMultiRuns(multis); proc.getStatistics().getStatisticsParameters().setMultiRuns(multis);
} }
/** /**
@@ -282,6 +282,6 @@ public class OptimizerRunnable implements Runnable {
* @param addInfo * @param addInfo
*/ */
public void setOutputFullStatsToText(boolean addInfo) { public void setOutputFullStatsToText(boolean addInfo) {
proc.getStatistics().getStatisticsParameter().setOutputAllFieldsAsText(addInfo); proc.getStatistics().getStatisticsParameters().setOutputAllFieldsAsText(addInfo);
} }
} }

View File

@@ -1,20 +1,26 @@
package eva2.cli; package eva2.cli;
import eva2.optimization.go.InterfaceOptimizationParameters; import eva2.optimization.go.InterfaceOptimizationParameters;
import eva2.optimization.individuals.InterfaceDataTypeDouble; import eva2.optimization.individuals.IndividualInterface;
import eva2.optimization.modules.Processor;
import eva2.optimization.operator.terminators.InterfaceTerminator; import eva2.optimization.operator.terminators.InterfaceTerminator;
import eva2.optimization.population.Population;
import eva2.optimization.population.PopulationInterface;
import eva2.optimization.statistics.InterfaceStatistics;
import eva2.optimization.statistics.InterfaceStatisticsListener;
import eva2.optimization.statistics.InterfaceStatisticsParameters; import eva2.optimization.statistics.InterfaceStatisticsParameters;
import eva2.optimization.statistics.InterfaceTextListener;
import eva2.optimization.strategies.InterfaceOptimizer; import eva2.optimization.strategies.InterfaceOptimizer;
import eva2.problems.InterfaceAdditionalPopulationInformer;
import eva2.problems.InterfaceOptimizationProblem; import eva2.problems.InterfaceOptimizationProblem;
import org.yaml.snakeyaml.Yaml;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.logging.Logger;
/** /**
* *
@@ -49,32 +55,91 @@ public class Main {
System.exit(0); System.exit(0);
} }
//optimizer.addPopulationChangedEventListener(new OptimizationLogger(parameters, )); Processor optimizationProcessor = new Processor(new YamlStatistics(statisticsParameters), parameters);
for (int i = 0; i < statisticsParameters.getMultiRuns(); i++) { optimizationProcessor.setSaveParams(false);
optimizationProcessor.startOptimization();
problem.initializeProblem();
problem.initializePopulation(optimizer.getPopulation());
optimizer.setProblem(problem); optimizationProcessor.runOptimizationOnce();
terminator.initialize(problem);
/**
* This is the main optimization loop. We keep calling
* optimize() until a termination criterion is met or
* the user aborts the optimization manually.
*/
do {
optimizer.optimize();
} while (!terminator.isTerminated(optimizer.getAllSolutions()));
System.out.println(Arrays.toString(((InterfaceDataTypeDouble)optimizer.getPopulation().getBestEAIndividual()).getDoubleData()));
}
try {
bw.write(new Yaml().dump(optimizationLog));
bw.close();
} catch (IOException ex) {
ex.printStackTrace();
} }
} }
final class YamlStatistics implements InterfaceStatistics {
private static final Logger LOGGER = Logger.getLogger(YamlStatistics.class.getName());
private InterfaceStatisticsParameters statisticsParameters;
public YamlStatistics(InterfaceStatisticsParameters statisticsParameters) {
super();
this.statisticsParameters = statisticsParameters;
}
@Override
public void startOptimizationPerformed(String infoString, int runNumber, InterfaceOptimizationParameters params, List<InterfaceAdditionalPopulationInformer> informerList) {
}
@Override
public void stopOptimizationPerformed(boolean normal, String stopMessage) {
}
@Override
public void addDataListener(InterfaceStatisticsListener listener) {
}
@Override
public boolean removeDataListener(InterfaceStatisticsListener listener) {
return false;
}
@Override
public void addTextListener(InterfaceTextListener listener) {
}
@Override
public boolean removeTextListener(InterfaceTextListener listener) {
return false;
}
@Override
public void printToTextListener(String s) {
System.out.println(s);
}
@Override
public void createNextGenerationPerformed(PopulationInterface Pop, InterfaceOptimizer opt, List<InterfaceAdditionalPopulationInformer> informerList) {
}
@Override
public void createNextGenerationPerformed(double[] bestFit, double[] worstFit, int calls) {
}
@Override
public InterfaceStatisticsParameters getStatisticsParameters() {
return statisticsParameters;
}
@Override
public IndividualInterface getRunBestSolution() {
return null;
}
@Override
public IndividualInterface getBestSolution() {
return null;
}
@Override
public double[] getBestFitness() {
return new double[0];
}
@Override
public void postProcessingPerformed(Population resultPop) {
}
} }

View File

@@ -11,7 +11,7 @@ import java.util.List;
public class TestingCbnPostProc { public class TestingCbnPostProc {
public static void main(String[] args) { public static void main(String[] args) {
// a eva2.problems.simple bimodal target function, two optima near (1.7,0) and (-1.44/0) // a simple bimodal target function, two optima near (1.7,0) and (-1.44/0)
FM0Problem fm0 = new FM0Problem(); FM0Problem fm0 = new FM0Problem();
AbstractEAIndividual best; AbstractEAIndividual best;
List<AbstractEAIndividual> ppSols; List<AbstractEAIndividual> ppSols;

View File

@@ -12,7 +12,7 @@ import eva2.problems.FM0Problem;
public class TestingPlusCmaEs { public class TestingPlusCmaEs {
public static void main(String[] args) { public static void main(String[] args) {
// a eva2.problems.simple bimodal target function, two optima near (1.7,0) and (-1.44/0) // a simple bimodal target function, two optima near (1.7,0) and (-1.44/0)
FM0Problem fm0 = new FM0Problem(); FM0Problem fm0 = new FM0Problem();
AbstractEAIndividual bestIndy; AbstractEAIndividual bestIndy;
// create standard ES parameters // create standard ES parameters

View File

@@ -602,7 +602,7 @@ public class Main extends JFrame implements OptimizationStateListener {
// GUI is ready // GUI is ready
evaClient.addWindowListener(windowListener); evaClient.addWindowListener(windowListener);
// modify initial settings and activate output of all data: // modify initial settings and activate output of all data:
evaClient.getStatistics().getStatisticsParameter().setOutputAllFieldsAsText(true); evaClient.getStatistics().getStatisticsParameters().setOutputAllFieldsAsText(true);
// add a data listener instance: // add a data listener instance:
evaClient.getStatistics().addDataListener(statisticsListener); evaClient.getStatistics().addDataListener(statisticsListener);
@@ -759,7 +759,7 @@ public class Main extends JFrame implements OptimizationStateListener {
} }
public InterfaceStatisticsParameters getStatisticsParameter() { public InterfaceStatisticsParameters getStatisticsParameter() {
return ((GenericModuleAdapter) currentModuleAdapter).getStatistics().getStatisticsParameter(); return ((GenericModuleAdapter) currentModuleAdapter).getStatistics().getStatisticsParameters();
} }
private void loadSpecificModule(String selectedModule, InterfaceOptimizationParameters optimizationParameters) { private void loadSpecificModule(String selectedModule, InterfaceOptimizationParameters optimizationParameters) {

View File

@@ -10,7 +10,7 @@ import java.beans.PropertyChangeSupport;
import java.beans.PropertyEditor; import java.beans.PropertyEditor;
/** /**
* A eva2.problems.simple focus listener with an object ID and callback. * A simple focus listener with an object ID and callback.
* *
* @author mkron * @author mkron
*/ */

View File

@@ -317,7 +317,7 @@ public class StandaloneOptimization implements InterfaceStandaloneOptimization,
break; break;
} }
case 1: { case 1: {
// use the eva2.problems.simple ES Local // use the simple ES Local
this.outputFileName = "X360_StandardES"; this.outputFileName = "X360_StandardES";
EvolutionStrategies es = new EvolutionStrategies(); EvolutionStrategies es = new EvolutionStrategies();
this.optimizationParameters.setOptimizer(es); this.optimizationParameters.setOptimizer(es);

View File

@@ -288,7 +288,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
} }
/** /**
* This method performs a eva2.problems.simple one element mutation on the double vector * This method performs a simple one element mutation on the double vector
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -339,7 +339,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
} }
/** /**
* This method performs a eva2.problems.simple one element mutation on the double vector * This method performs a simple one element mutation on the double vector
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -303,7 +303,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
} }
/** /**
* This method performs a eva2.problems.simple one element mutation on the double vector * This method performs a simple one element mutation on the double vector
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -88,7 +88,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
} }
/** /**
* This method evaluates the GAIndividual as eva2.problems.simple minimize number * This method evaluates the GAIndividual as simple minimize number
* of bits problem. * of bits problem.
* *
* @return The number of true bits * @return The number of true bits
@@ -218,7 +218,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
} }
/** /**
* This method performs a eva2.problems.simple one point mutation in the genotype * This method performs a simple one point mutation in the genotype
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -339,7 +339,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
} }
/** /**
* This method performs a eva2.problems.simple one point mutation in the genotype * This method performs a simple one point mutation in the genotype
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -398,7 +398,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
} }
/** /**
* This method performs a eva2.problems.simple one point mutation in the genotype * This method performs a simple one point mutation in the genotype
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -674,7 +674,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
} }
/** /**
* This method performs a eva2.problems.simple one point mutation in the genotype * This method performs a simple one point mutation in the genotype
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -317,7 +317,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
} }
/** /**
* This method performs a eva2.problems.simple one point mutation in the genotype * This method performs a simple one point mutation in the genotype
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -313,7 +313,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
} }
/** /**
* This method performs a eva2.problems.simple one element mutation on the program * This method performs a simple one element mutation on the program
*/ */
@Override @Override
public void defaultMutate() { public void defaultMutate() {

View File

@@ -85,7 +85,7 @@ public class GAGrayCodingDouble implements InterfaceGADoubleCoding, java.io.Seri
} }
/** /**
* A eva2.problems.simple test method * A simple test method
* *
* @param args no args needed * @param args no args needed
*/ */

View File

@@ -130,7 +130,7 @@ public class GAStandardCodingDouble implements InterfaceGADoubleCoding, java.io.
} }
/** /**
* A eva2.problems.simple test function without arguments * A simple test function without arguments
*/ */
public static void main() { public static void main() {
GAStandardCodingDouble t = new GAStandardCodingDouble(); GAStandardCodingDouble t = new GAStandardCodingDouble();

View File

@@ -4,7 +4,7 @@ package eva2.optimization.individuals.codings.gp;
import eva2.problems.InterfaceProgramProblem; import eva2.problems.InterfaceProgramProblem;
/** /**
* A eva2.problems.simple add node with two arguments. * A simple add node with two arguments.
*/ */
public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable { public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable {

View File

@@ -3,7 +3,7 @@ package eva2.optimization.individuals.codings.gp;
import eva2.problems.InterfaceProgramProblem; import eva2.problems.InterfaceProgramProblem;
/** /**
* A eva2.problems.simple constant node with the value 1. * A simple constant node with the value 1.
*/ */
public class GPNodeConst extends AbstractGPNode implements java.io.Serializable { public class GPNodeConst extends AbstractGPNode implements java.io.Serializable {
double value = 1.; double value = 1.;

View File

@@ -2,7 +2,7 @@ package eva2.optimization.individuals.codings.gp;
/** /**
* A eva2.problems.simple constant node with the value 1. * A simple constant node with the value 1.
*/ */
public class GPNodeOne extends GPNodeConst implements java.io.Serializable { public class GPNodeOne extends GPNodeConst implements java.io.Serializable {
public GPNodeOne() { public GPNodeOne() {

View File

@@ -2,7 +2,7 @@ package eva2.optimization.individuals.codings.gp;
/** /**
* A eva2.problems.simple constant node with the value 1. * A simple constant node with the value 1.
*/ */
public class GPNodePi extends GPNodeConst implements java.io.Serializable { public class GPNodePi extends GPNodeConst implements java.io.Serializable {
public GPNodePi() { public GPNodePi() {

View File

@@ -5,7 +5,7 @@ import eva2.problems.InterfaceProgramProblem;
import eva2.tools.math.Mathematics; import eva2.tools.math.Mathematics;
/** /**
* A eva2.problems.simple product node with a single, possibly vectorial (array), argument. * A simple product node with a single, possibly vectorial (array), argument.
*/ */
public class GPNodeProd extends AbstractGPNode implements java.io.Serializable { public class GPNodeProd extends AbstractGPNode implements java.io.Serializable {

View File

@@ -5,7 +5,7 @@ import eva2.problems.InterfaceProgramProblem;
import eva2.tools.math.Mathematics; import eva2.tools.math.Mathematics;
/** /**
* A eva2.problems.simple sum node with a single, possibly vectorial (array), argument. * A simple sum node with a single, possibly vectorial (array), argument.
*/ */
public class GPNodeSum extends AbstractGPNode implements java.io.Serializable { public class GPNodeSum extends AbstractGPNode implements java.io.Serializable {

View File

@@ -351,7 +351,7 @@ public class MOCCOViewer extends JPanel implements InterfaceRefSolutionListener,
} }
/** /**
* This method will plot a eva2.problems.simple fitness plot, using the iterations a x-axis * This method will plot a simple fitness plot, using the iterations a x-axis
*/ */
public void plot1DFitnessPlot() { public void plot1DFitnessPlot() {
double xmin = 0, ymin = Double.POSITIVE_INFINITY, xmax = Double.NEGATIVE_INFINITY, ymax = Double.NEGATIVE_INFINITY, fitness; double xmin = 0, ymin = Double.POSITIVE_INFINITY, xmax = Double.NEGATIVE_INFINITY, ymax = Double.NEGATIVE_INFINITY, fitness;

View File

@@ -175,7 +175,7 @@ public class ParetoFrontView2D extends JPanel implements InterfaceParetoFrontVie
} }
/** /**
* This method will plot a eva2.problems.simple fitness plot, using the iterations a x-axis * This method will plot a simple fitness plot, using the iterations a x-axis
*/ */
public void plot2DParetoFront() { public void plot2DParetoFront() {
double xmin = Double.POSITIVE_INFINITY, ymin = Double.POSITIVE_INFINITY, xmax = Double.NEGATIVE_INFINITY, ymax = Double.NEGATIVE_INFINITY; double xmin = Double.POSITIVE_INFINITY, ymin = Double.POSITIVE_INFINITY, xmax = Double.NEGATIVE_INFINITY, ymax = Double.NEGATIVE_INFINITY;

View File

@@ -79,7 +79,7 @@ public class GenericModuleAdapter extends AbstractModuleAdapter implements Seria
} }
EvATabbedFrameMaker frmMkr = new EvATabbedFrameMaker(); EvATabbedFrameMaker frmMkr = new EvATabbedFrameMaker();
InterfaceStatisticsParameters Stat = statisticsModule.getStatisticsParameter(); InterfaceStatisticsParameters Stat = statisticsModule.getStatisticsParameters();
EvAModuleButtonPanelMaker buttonPanel = new EvAModuleButtonPanelMaker(remoteModuleAdapter, ((Processor) processor).isOptimizationRunning()); EvAModuleButtonPanelMaker buttonPanel = new EvAModuleButtonPanelMaker(remoteModuleAdapter, ((Processor) processor).isOptimizationRunning());
buttonPanel.setHelperFilename(helperFilename); buttonPanel.setHelperFilename(helperFilename);
frmMkr.addPanelMaker(buttonPanel); frmMkr.addPanelMaker(buttonPanel);

View File

@@ -73,9 +73,9 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
// the statistics want to be informed if the strategy or the optimizer (which provide statistical data as InterfaceAdditionalInformer) change. // the statistics want to be informed if the strategy or the optimizer (which provide statistical data as InterfaceAdditionalInformer) change.
if (statistics != null && (optimizationParameters != null)) { if (statistics != null && (optimizationParameters != null)) {
if (statistics.getStatisticsParameter() instanceof InterfaceNotifyOnInformers) { if (statistics.getStatisticsParameters() instanceof InterfaceNotifyOnInformers) {
// addition for the statistics revision with selectable strings - make sure the go parameters are represented within the statistics // addition for the statistics revision with selectable strings - make sure the go parameters are represented within the statistics
optimizationParameters.addInformableInstance((InterfaceNotifyOnInformers) (statistics.getStatisticsParameter())); optimizationParameters.addInformableInstance((InterfaceNotifyOnInformers) (statistics.getStatisticsParameters()));
} }
} }
} }
@@ -232,8 +232,8 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
* We keep the optimization running until it is aborted by the user or * We keep the optimization running until it is aborted by the user or
* the number of multiple runs has been reached. * the number of multiple runs has been reached.
*/ */
while (isOptimizationRunning() && (runCounter < statistics.getStatisticsParameter().getMultiRuns())) { while (isOptimizationRunning() && (runCounter < statistics.getStatisticsParameters().getMultiRuns())) {
LOGGER.info(String.format("Starting Optimization %d/%d", runCounter + 1, statistics.getStatisticsParameter().getMultiRuns())); LOGGER.info(String.format("Starting Optimization %d/%d", runCounter + 1, statistics.getStatisticsParameters().getMultiRuns()));
statistics.startOptimizationPerformed(getInfoString(), runCounter, optimizationParameters, getInformerList()); statistics.startOptimizationPerformed(getInfoString(), runCounter, optimizationParameters, getInformerList());
problem.initializeProblem(); problem.initializeProblem();
@@ -246,7 +246,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
} }
if (optimizationStateListener != null) { if (optimizationStateListener != null) {
optimizationStateListener.updateProgress(getStatusPercent(optimizer.getPopulation(), runCounter, statistics.getStatisticsParameter().getMultiRuns()), null); optimizationStateListener.updateProgress(getStatusPercent(optimizer.getPopulation(), runCounter, statistics.getStatisticsParameters().getMultiRuns()), null);
} }
/** /**
@@ -388,7 +388,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
getStatusPercent( getStatusPercent(
optimizationParameters.getOptimizer().getPopulation(), optimizationParameters.getOptimizer().getPopulation(),
runCounter, runCounter,
statistics.getStatisticsParameter().getMultiRuns()), statistics.getStatisticsParameters().getMultiRuns()),
null); null);
} }
} }
@@ -442,7 +442,12 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
} }
public Population performPostProcessing() { public Population performPostProcessing() {
return performPostProcessing((PostProcessParams) optimizationParameters.getPostProcessParams(), (InterfaceTextListener) statistics); PostProcessParams ppp = (PostProcessParams)optimizationParameters.getPostProcessParams();
if (ppp.isDoPostProcessing()) {
return performPostProcessing(ppp, (InterfaceTextListener) statistics);
} else {
return null;
}
} }
/** /**

View File

@@ -6,7 +6,7 @@ import eva2.optimization.population.Population;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
/** /**
* This eva2.problems.simple strategy simply archives all Pareto optimal solutions. This method is * This simple strategy simply archives all Pareto optimal solutions. This method is
* very prone to OutOfMemory errors! * very prone to OutOfMemory errors!
*/ */
@Description("This is a straightforward strategy, which selects all dominating individuals (very prone to generate OutOfMemory errors).") @Description("This is a straightforward strategy, which selects all dominating individuals (very prone to generate OutOfMemory errors).")

View File

@@ -10,7 +10,7 @@ import eva2.util.annotation.Description;
/** /**
* Another eva2.problems.simple archiving strategy not based on dominance but on the MaxiMin * Another simple archiving strategy not based on dominance but on the MaxiMin
* criterion. Doesn't work well on non-convex Pareto fronts. * criterion. Doesn't work well on non-convex Pareto fronts.
*/ */
@Description("Maxi Min Archiving.") @Description("Maxi Min Archiving.")

View File

@@ -10,7 +10,7 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
/** /**
* Self-organizing maps, a eva2.problems.simple, but easy to visualize method * Self-organizing maps, a simple, but easy to visualize method
* for classification. The Dikel flag is an undocumented extension, * for classification. The Dikel flag is an undocumented extension,
* which seems to work but is not published. * which seems to work but is not published.
*/ */

View File

@@ -4,7 +4,7 @@ import eva2.optimization.population.Population;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
/** /**
* A eva2.problems.simple sum to calculate the selection probability. * A simple sum to calculate the selection probability.
* <p> * <p>
* p(i is selected) = exp(-fitness(i))/sum_j(exp(-fitness(j))) * p(i is selected) = exp(-fitness(i))/sum_j(exp(-fitness(j)))
*/ */

View File

@@ -4,7 +4,7 @@ import eva2.optimization.population.Population;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
/** /**
* A eva2.problems.simple sum with a scaling factor. * A simple sum with a scaling factor.
*/ */
@Description("This is a standard normation method with scaling.") @Description("This is a standard normation method with scaling.")
public class SelProbStandardScaling extends AbstractSelProb implements java.io.Serializable { public class SelProbStandardScaling extends AbstractSelProb implements java.io.Serializable {

View File

@@ -2182,7 +2182,7 @@ public class Population extends ArrayList<AbstractEAIndividual> implements Popul
/** /**
* Calculate the average of the distance of each individual to its closest * Calculate the average of the distance of each individual to its closest
* neighbor in the population. The boolean parameter switches between * neighbor in the population. The boolean parameter switches between
* range-normalized and eva2.problems.simple euclidian distance. If calcVariance is true, * range-normalized and simple euclidian distance. If calcVariance is true,
* the variance is calculated and returned as second entry * the variance is calculated and returned as second entry
* *
* @param normalizedPhenoMetric * @param normalizedPhenoMetric

View File

@@ -209,7 +209,7 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
} }
/** /**
* Return a eva2.problems.simple String describing the current date and time. * Return a simple String describing the current date and time.
* *
* @return * @return
*/ */
@@ -297,7 +297,7 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
ToDo: Figure out if we need this. Right now it is just spamming the text output ToDo: Figure out if we need this. Right now it is just spamming the text output
if (printRunIntroVerbosity()) { if (printRunIntroVerbosity()) {
printToTextListener("\nStatistics parameters: "); printToTextListener("\nStatistics parameters: ");
printToTextListener(BeanInspector.niceToString(getStatisticsParameter()) + '\n'); printToTextListener(BeanInspector.niceToString(getStatisticsParameters()) + '\n');
} }
*/ */
functionCalls = 0; functionCalls = 0;
@@ -645,7 +645,7 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
} }
@Override @Override
public InterfaceStatisticsParameters getStatisticsParameter() { public InterfaceStatisticsParameters getStatisticsParameters() {
return statisticsParameter; return statisticsParameter;
} }
@@ -780,7 +780,7 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
} }
/** /**
* Return all eva2.problems.simple data fields collected internally. This must correspond to the * Return all simple data fields collected internally. This must correspond to the
* method {@link #getSimpleOutputHeader()}. * method {@link #getSimpleOutputHeader()}.
* *
* @return * @return
@@ -1151,7 +1151,6 @@ public abstract class AbstractStatistics implements InterfaceTextListener, Inter
} // this adds up data of a single iteration across multiple runs } // this adds up data of a single iteration across multiple runs
} }
} }
plotCurrentResults(); plotCurrentResults();
fireDataListeners(); fireDataListeners();
if (resultOut != null) { if (resultOut != null) {

View File

@@ -37,7 +37,7 @@ public interface InterfaceStatistics {
void createNextGenerationPerformed(double[] bestFit, double[] worstFit, int calls); void createNextGenerationPerformed(double[] bestFit, double[] worstFit, int calls);
InterfaceStatisticsParameters getStatisticsParameter(); // called from moduleadapter InterfaceStatisticsParameters getStatisticsParameters(); // called from moduleadapter
IndividualInterface getRunBestSolution(); // return the best fitness of the last run (may not be equal to the last population) IndividualInterface getRunBestSolution(); // return the best fitness of the last run (may not be equal to the last population)

View File

@@ -1,7 +1,7 @@
package eva2.optimization.statistics; package eva2.optimization.statistics;
/** /**
* A very eva2.problems.simple interface class to receive raw String data. * A very simple interface class to receive raw String data.
* *
* @author mkron * @author mkron
*/ */

View File

@@ -208,8 +208,8 @@ public class OptimizationJobList extends PropertySelectableList<OptimizationJob>
AbstractOptimizationParameters curParams = (AbstractOptimizationParameters) ((AbstractModuleAdapter) jobList.module).getOptimizationParameters(); AbstractOptimizationParameters curParams = (AbstractOptimizationParameters) ((AbstractModuleAdapter) jobList.module).getOptimizationParameters();
curParams.setSameParams((AbstractOptimizationParameters) job.getOptimizationParameters()); curParams.setSameParams((AbstractOptimizationParameters) job.getOptimizationParameters());
((GenericModuleAdapter) jobList.module).setOptimizationParameters(curParams); ((GenericModuleAdapter) jobList.module).setOptimizationParameters(curParams);
((GenericModuleAdapter) jobList.module).getStatistics().getStatisticsParameter().setMultiRuns(job.getNumRuns()); ((GenericModuleAdapter) jobList.module).getStatistics().getStatisticsParameters().setMultiRuns(job.getNumRuns());
((GenericModuleAdapter) jobList.module).getStatistics().getStatisticsParameter().setFieldSelection(job.getFieldSelection(((GenericModuleAdapter) jobList.module).getStatistics().getStatisticsParameter().getFieldSelection())); ((GenericModuleAdapter) jobList.module).getStatistics().getStatisticsParameters().setFieldSelection(job.getFieldSelection(((GenericModuleAdapter) jobList.module).getStatistics().getStatisticsParameters().getFieldSelection()));
} else { } else {
JOptionPane.showMessageDialog(parent, "Select exactly one job to reuse!", "Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(parent, "Select exactly one job to reuse!", "Error", JOptionPane.ERROR_MESSAGE);
} }

View File

@@ -74,7 +74,7 @@ public class StatisticsDummy implements InterfaceStatistics, InterfaceTextListen
} }
@Override @Override
public InterfaceStatisticsParameters getStatisticsParameter() { public InterfaceStatisticsParameters getStatisticsParameters() {
return sParams; return sParams;
} }

View File

@@ -145,7 +145,7 @@ public class FloodAlgorithm extends AbstractOptimizer implements java.io.Seriali
} }
/** /**
* This main method will start a eva2.problems.simple hillclimber. No arguments necessary. * This main method will start a simple hillclimber. No arguments necessary.
*/ */
public static void main() { public static void main() {
FloodAlgorithm program = new FloodAlgorithm(); FloodAlgorithm program = new FloodAlgorithm();

View File

@@ -16,7 +16,7 @@ import eva2.util.annotation.Description;
*/ */
@Description("The Hill Climber uses the default EA mutation and initializing operators. If the population size is bigger than one a multi-start Hill Climber is performed.") @Description("The Hill Climber uses the default EA mutation and initializing operators. If the population size is bigger than one a multi-start Hill Climber is performed.")
public class HillClimbing extends AbstractOptimizer implements java.io.Serializable { public class HillClimbing extends AbstractOptimizer implements java.io.Serializable {
// These variables are necessary for the eva2.problems.simple testcase // These variables are necessary for the simple testcase
private InterfaceOptimizationProblem optimizationProblem = new B1Problem(); private InterfaceOptimizationProblem optimizationProblem = new B1Problem();
private InterfaceMutation mutator = null; private InterfaceMutation mutator = null;

View File

@@ -8,7 +8,7 @@ import eva2.problems.InterfaceOptimizationProblem;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
/** /**
* The eva2.problems.simple random or Monte-Carlo search, eva2.problems.simple but useful to evaluate the * The simple random or Monte-Carlo search, simple but useful to evaluate the
* complexity of the search space. This implements a Random Walk Search using * complexity of the search space. This implements a Random Walk Search using
* the initialization method of the problem instance, meaning that the random * the initialization method of the problem instance, meaning that the random
* characteristics may be problem dependent. * characteristics may be problem dependent.
@@ -115,7 +115,7 @@ public class MonteCarloSearch extends AbstractOptimizer implements java.io.Seria
} }
/** /**
* This main method will start a eva2.problems.simple hillclimber. No arguments necessary. * This main method will start a simple hillclimber. No arguments necessary.
* *
* @param args * @param args
*/ */

View File

@@ -16,7 +16,7 @@ import java.util.logging.Logger;
/** /**
* Population based incremental learning in the PSM by Monmarche version with * Population based incremental learning in the PSM by Monmarche version with
* also allows to simulate ant systems due to the flexible update rule of V. But * also allows to simulate ant systems due to the flexible update rule of V. But
* both are limited to binary genotypes. This is a eva2.problems.simple implementation of * both are limited to binary genotypes. This is a simple implementation of
* Population Based Incremental Learning. * Population Based Incremental Learning.
* <p> * <p>
* Nicolas Monmarché , Eric Ramat , Guillaume Dromel , Mohamed Slimane , Gilles * Nicolas Monmarché , Eric Ramat , Guillaume Dromel , Mohamed Slimane , Gilles
@@ -27,7 +27,7 @@ import java.util.logging.Logger;
public class PopulationBasedIncrementalLearning extends AbstractOptimizer implements java.io.Serializable { public class PopulationBasedIncrementalLearning extends AbstractOptimizer implements java.io.Serializable {
private final static Logger LOGGER = Logger.getLogger(PopulationBasedIncrementalLearning.class.getName()); private final static Logger LOGGER = Logger.getLogger(PopulationBasedIncrementalLearning.class.getName());
// These variables are necessary for the eva2.problems.simple testcase // These variables are necessary for the simple testcase
private InterfaceOptimizationProblem optimizationProblem = new B1Problem(); private InterfaceOptimizationProblem optimizationProblem = new B1Problem();
private boolean useElitism = true; private boolean useElitism = true;
private InterfaceSelection selectionOperator = new SelectBestIndividuals(); private InterfaceSelection selectionOperator = new SelectBestIndividuals();

View File

@@ -10,7 +10,7 @@ import eva2.tools.math.RNG;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
/** /**
* Simulated Annealing by Nelder and Mead, a eva2.problems.simple yet efficient local search * Simulated Annealing by Nelder and Mead, a simple yet efficient local search
* method. But to become less prone to premature convergence the cooling rate * method. But to become less prone to premature convergence the cooling rate
* has to be tuned to the optimization problem at hand. Again the population * has to be tuned to the optimization problem at hand. Again the population
* size gives the number of multi-starts. * size gives the number of multi-starts.
@@ -149,7 +149,7 @@ public class SimulatedAnnealing extends AbstractOptimizer implements java.io.Ser
} }
/** /**
* This main method will start a eva2.problems.simple hillclimber. No arguments necessary. * This main method will start a simple hillclimber. No arguments necessary.
* *
* @param args * @param args
*/ */

View File

@@ -14,7 +14,7 @@ import eva2.problems.InterfaceOptimizationProblem;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
/** /**
* A eva2.problems.simple implementation of the steady-state GA with variable replacement * A simple implementation of the steady-state GA with variable replacement
* schemes. To reduce the logging effort population.size() optimization steps * schemes. To reduce the logging effort population.size() optimization steps
* are performed each time optimize() is called. * are performed each time optimize() is called.
*/ */

View File

@@ -140,7 +140,7 @@ public class ThresholdAlgorithm extends AbstractOptimizer implements java.io.Ser
} }
/** /**
* This main method will start a eva2.problems.simple hillclimber. No arguments necessary. * This main method will start a simple hillclimber. No arguments necessary.
* *
* @param args * @param args
*/ */

View File

@@ -82,7 +82,7 @@ public abstract class AbstractMultiModalProblemKnown extends AbstractProblemDoub
} }
/** /**
* Ths method allows you to evaluate a eva2.problems.simple bit string to determine the fitness * Ths method allows you to evaluate a simple bit string to determine the fitness
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -70,7 +70,7 @@ public abstract class AbstractProblemInteger extends AbstractOptimizationProblem
} }
/** /**
* Evaluate a eva2.problems.simple integer array to determine the fitness. * Evaluate a simple integer array to determine the fitness.
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -40,7 +40,7 @@ public class B1Problem extends AbstractProblemBinary implements java.io.Serializ
} }
/** /**
* This is a eva2.problems.simple method that evaluates a given Individual. The fitness * This is a simple method that evaluates a given Individual. The fitness
* values of the individual will be set inside this method. * values of the individual will be set inside this method.
* *
* @param b The BitSet that is to be evaluated. * @param b The BitSet that is to be evaluated.

View File

@@ -258,7 +258,7 @@ public class BKnapsackProblem extends AbstractProblemBinary implements java.io.S
} }
/** /**
* This is a eva2.problems.simple method that evaluates a given Individual. The fitness * This is a simple method that evaluates a given Individual. The fitness
* values of the individual will be set inside this method. * values of the individual will be set inside this method.
* *
* @param b The BitSet that is to be evaluated. * @param b The BitSet that is to be evaluated.

View File

@@ -9,7 +9,7 @@ import java.io.Serializable;
import java.util.Vector; import java.util.Vector;
/** /**
* Himmelblau's nonlinear optimization problem with 5 eva2.problems.simple boundary constraints and 3 nonlinear boundary constraints. * Himmelblau's nonlinear optimization problem with 5 simple boundary constraints and 3 nonlinear boundary constraints.
*/ */
@Description("Himmelblau's nonlinear optimization problem") @Description("Himmelblau's nonlinear optimization problem")
public class ConstrHimmelblauProblem extends AbstractProblemDouble implements Serializable { public class ConstrHimmelblauProblem extends AbstractProblemDouble implements Serializable {

View File

@@ -41,7 +41,7 @@ public class F1Problem extends AbstractProblemDoubleOffset implements Interface2
} }
/** /**
* This method allows you to evaluate a eva2.problems.simple bit string to determine the fitness * This method allows you to evaluate a simple bit string to determine the fitness
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -39,7 +39,7 @@ public class F22Problem extends AbstractProblemDoubleOffset implements Interface
} }
/** /**
* This method allows you to evaluate a eva2.problems.simple bit string to determine the fitness * This method allows you to evaluate a simple bit string to determine the fitness
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -327,7 +327,7 @@ public class FLensProblem extends AbstractOptimizationProblem
} }
/** /**
* Ths method allows you to evaluate a eva2.problems.simple bit string to determine the fitness * Ths method allows you to evaluate a simple bit string to determine the fitness
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -28,7 +28,7 @@ public class I1Problem extends AbstractProblemInteger implements java.io.Seriali
} }
/** /**
* Ths method allows you to evaluate a eva2.problems.simple bit string to determine the fitness * Ths method allows you to evaluate a simple bit string to determine the fitness
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -152,7 +152,7 @@ public class TF1Problem extends AbstractMultiObjectiveOptimizationProblem implem
} }
/** /**
* Ths method allows you to evaluate a eva2.problems.simple bit string to determine the fitness * Ths method allows you to evaluate a simple bit string to determine the fitness
* *
* @param x The n-dimensional input vector * @param x The n-dimensional input vector
* @return The m-dimensional output vector. * @return The m-dimensional output vector.

View File

@@ -1,7 +1,7 @@
package eva2.problems.simple; package eva2.problems.simple;
/** /**
* A eva2.problems.simple interface to easily include new optimization problems in Java into the * A simple interface to easily include new optimization problems in Java into the
* EvA framework. * EvA framework.
*/ */
public interface InterfaceSimpleProblem<T> { public interface InterfaceSimpleProblem<T> {

View File

@@ -332,7 +332,7 @@ public class MultirunRefiner {
// } // }
/** /**
* A eva2.problems.simple method to read doubles from a string. * A simple method to read doubles from a string.
* *
* @param searchme The string to be searched. * @param searchme The string to be searched.
* @return The array of doubles found. * @return The array of doubles found.

View File

@@ -8,7 +8,7 @@ package eva2.tools;
import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileFilter;
/**A eva2.problems.simple File Filter for *.txt files. /**A simple File Filter for *.txt files.
*/ */
public class TXTFileFilter extends FileFilter { public class TXTFileFilter extends FileFilter {

View File

@@ -3,7 +3,7 @@ package eva2.tools.chart2d;
import java.awt.*; import java.awt.*;
/** /**
* A eva2.problems.simple interface which can be used to paint certain icons at DPoints * A simple interface which can be used to paint certain icons at DPoints
* ( @see chart2d.DPoint.setIcon or chart2d.DPointSet.setIcon ). * ( @see chart2d.DPoint.setIcon or chart2d.DPointSet.setIcon ).
* Different points may be easier recognized in a complex graph. * Different points may be easier recognized in a complex graph.
* The container does not guarantee that the whole icon is visible in the graph * The container does not guarantee that the whole icon is visible in the graph

View File

@@ -1674,7 +1674,7 @@ public class JMatLink extends Thread {
// this is a concurrent situation. // this is a concurrent situation.
// The solution is eva2.problems.simple: I always use a locking-mechanism to wait for the // The solution is simple: I always use a locking-mechanism to wait for the
// data. The main thread will release the lock and the calling method can // data. The main thread will release the lock and the calling method can