From 2f2f935294d858621d96fa699a225d6815066147 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Mon, 30 Nov 2015 12:43:10 +0100 Subject: [PATCH] Automated code cleanup with IntelliJ 15 --- .../gui/InterfaceSelectablePointIcon.java | 10 +++--- src/eva2/gui/PanelMaker.java | 2 +- src/eva2/gui/editor/ComponentFilter.java | 2 +- src/eva2/gui/plot/DataViewerInterface.java | 4 +-- .../gui/plot/InterfaceDPointWithContent.java | 10 +++--- src/eva2/gui/plot/PlotInterface.java | 22 ++++++------ src/eva2/optimization/EvAMainAdapter.java | 2 +- .../InterfaceNotifyOnInformers.java | 2 +- .../individuals/AbstractEAIndividual.java | 5 +-- .../GAESIndividualBinaryDoubleData.java | 5 +-- .../individuals/GAIndividualBinaryData.java | 5 +-- .../individuals/GAPIndividualProgramData.java | 5 +-- .../individuals/GEIndividualProgramData.java | 5 +-- ...IOBGAIndividualIntegerPermutationData.java | 5 +-- .../individuals/InterfaceDataTypeBinary.java | 12 +++---- .../individuals/InterfaceDataTypeDouble.java | 16 ++++----- .../individuals/InterfaceDataTypeInteger.java | 16 ++++----- .../InterfaceDataTypePermutation.java | 8 ++--- .../individuals/InterfaceDataTypeProgram.java | 14 ++++---- .../individuals/InterfaceESIndividual.java | 6 ++-- .../individuals/InterfaceGAIndividual.java | 6 ++-- .../individuals/InterfaceGIIndividual.java | 12 +++---- .../individuals/InterfaceGPIndividual.java | 10 +++--- .../individuals/InterfaceOBGAIndividual.java | 4 +-- .../codings/ga/InterfaceGADoubleCoding.java | 4 +-- .../codings/ga/InterfaceGAIntegerCoding.java | 6 ++-- .../codings/gp/InterfaceProgram.java | 4 +-- .../mocco/InterfaceProcessElement.java | 4 +-- .../InterfaceParetoFrontView.java | 2 +- .../InterfaceRefPointListener.java | 2 +- .../InterfaceRefSolutionListener.java | 2 +- .../operator/archiving/ArchivingPESAII.java | 8 ++--- .../archiving/InterfaceArchiving.java | 4 +-- .../InterfaceInformationRetrieval.java | 4 +-- .../InterfaceRemoveSurplusIndividuals.java | 4 +-- .../InterfaceClassification.java | 8 ++--- .../cluster/ClusteringDensityBased.java | 6 +--- .../operator/cluster/ClusteringKMeans.java | 6 +--- .../cluster/ClusteringNearestBetter.java | 12 ++----- .../operator/cluster/InterfaceClustering.java | 10 +++--- .../InterfaceClusteringDistanceParam.java | 4 +-- .../InterfaceClusteringMetricBased.java | 4 +-- ...tObjectivesInEqualityBiggerThanLinear.java | 6 +--- ...ObjectivesInEqualityBiggerThanSurface.java | 6 +--- ...tObjectivesInEqualityLesserThanLinear.java | 6 +--- ...bjectivesInEqualitySmallerThanSurface.java | 6 +--- .../constraint/InterfaceConstraint.java | 4 +-- .../constraint/InterfaceDoubleConstraint.java | 6 ++-- .../operator/crossover/CrossoverOBGAPMX.java | 6 +--- .../crossover/CrossoverOBGAPMXUniform.java | 6 +--- .../crossover/InterfaceCrossover.java | 10 +++--- .../InterfaceEvaluatingCrossoverOperator.java | 4 +-- .../InterfaceDistanceMetric.java | 4 +-- .../InterfaceFitnessModifier.java | 2 +- .../InterfaceInitialization.java | 4 +-- .../migration/InterfaceMigration.java | 6 ++-- .../operator/moso/InterfaceMOSOConverter.java | 12 +++---- .../InterfaceAdaptOperatorGenerational.java | 4 +-- .../operator/mutation/InterfaceMutation.java | 12 +++---- .../InterfaceAbsorptionStrategy.java | 6 ++-- .../StandardAbsorptionStrategy.java | 11 ++---- .../InterfaceDeactivationStrategy.java | 6 ++-- .../merging/InterfaceMergingStrategy.java | 6 ++-- .../merging/StandardMergingStrategy.java | 10 ++---- .../InterfaceSubswarmCreationStrategy.java | 6 ++-- .../StandardSubswarmCreationStrategy.java | 5 +-- .../paramcontrol/GenericParamAdaption.java | 2 +- .../InterfaceHasUpperDoubleBound.java | 4 +-- .../InterfaceParamControllable.java | 8 ++--- .../InterfaceParameterControl.java | 10 +++--- .../operator/paramcontrol/ParamAdaption.java | 10 +++--- .../paramcontrol/ParamChangeListener.java | 2 +- .../InterfaceParetoFrontMetric.java | 4 +-- .../InterfacePostProcessParams.java | 34 +++++++++---------- .../selection/InterfaceSelection.java | 10 +++--- .../InterfaceSelectionProbability.java | 8 ++--- .../replacement/InterfaceReplacement.java | 4 +-- .../terminators/InterfaceTerminator.java | 10 +++--- .../population/InterfaceSolutionSet.java | 6 ++-- .../InterfaceStatisticsListener.java | 10 +++--- .../InterfaceStatisticsParameters.java | 4 +-- .../statistics/InterfaceTextListener.java | 4 +-- .../strategies/InterfaceSpeciesAware.java | 10 +++--- src/eva2/problems/F8Problem.java | 6 +--- .../problems/Interface2DBorderProblem.java | 6 ++-- ...InterfaceAdditionalPopulationInformer.java | 6 ++-- .../InterfaceFirstOrderDerivableProblem.java | 2 +- src/eva2/problems/InterfaceHasInitRange.java | 2 +- .../problems/InterfaceHasSolutionViewer.java | 2 +- .../InterfaceInterestingHistogram.java | 2 +- .../problems/InterfaceLocalSearchable.java | 4 +-- .../InterfaceMultiObjectiveDeNovoProblem.java | 6 ++-- .../InterfaceMultimodalProblemKnown.java | 12 +++---- .../InterfaceOptimizationObjective.java | 16 ++++----- .../InterfaceOptimizationProblem.java | 24 ++++++------- .../problems/InterfaceOptimizationTarget.java | 4 +-- src/eva2/problems/InterfaceProblemDouble.java | 10 +++--- .../problems/InterfaceProgramProblem.java | 6 ++-- .../problems/InterfaceSolutionViewer.java | 6 ++-- .../InterfaceRegressionFunction.java | 4 +-- .../simple/InterfaceSimpleProblem.java | 4 +-- src/eva2/tools/SelectedTag.java | 8 ++--- 102 files changed, 310 insertions(+), 396 deletions(-) diff --git a/src/eva2/gui/InterfaceSelectablePointIcon.java b/src/eva2/gui/InterfaceSelectablePointIcon.java index e456e940..424da61a 100644 --- a/src/eva2/gui/InterfaceSelectablePointIcon.java +++ b/src/eva2/gui/InterfaceSelectablePointIcon.java @@ -14,19 +14,19 @@ public interface InterfaceSelectablePointIcon { * * @param a The selection listener */ - public void addSelectionListener(InterfaceRefSolutionListener a); + void addSelectionListener(InterfaceRefSolutionListener a); /** * This method allows to remove the selection listner to the PointIcon */ - public void removeSelectionListeners(); + void removeSelectionListeners(); /** * This method returns the selection listner to the PointIcon * * @return InterfacePointIconSelectionListener */ - public InterfaceRefSolutionListener getSelectionListener(); + InterfaceRefSolutionListener getSelectionListener(); /** * Of course the PointIcon needs a reference to the individual @@ -34,12 +34,12 @@ public interface InterfaceSelectablePointIcon { * * @param indy */ - public void setEAIndividual(AbstractEAIndividual indy); + void setEAIndividual(AbstractEAIndividual indy); /** * This method allows you to get the EAIndividual the icon stands for * * @return AbstractEAIndividual */ - public AbstractEAIndividual getEAIndividual(); + AbstractEAIndividual getEAIndividual(); } diff --git a/src/eva2/gui/PanelMaker.java b/src/eva2/gui/PanelMaker.java index 51594512..8e897d33 100644 --- a/src/eva2/gui/PanelMaker.java +++ b/src/eva2/gui/PanelMaker.java @@ -8,5 +8,5 @@ import javax.swing.*; * @author mkron */ public interface PanelMaker { - public JComponent makePanel(); + JComponent makePanel(); } diff --git a/src/eva2/gui/editor/ComponentFilter.java b/src/eva2/gui/editor/ComponentFilter.java index 382cac94..128b8189 100644 --- a/src/eva2/gui/editor/ComponentFilter.java +++ b/src/eva2/gui/editor/ComponentFilter.java @@ -4,5 +4,5 @@ package eva2.gui.editor; * */ public interface ComponentFilter { - public boolean accept(java.awt.Component component); + boolean accept(java.awt.Component component); } diff --git a/src/eva2/gui/plot/DataViewerInterface.java b/src/eva2/gui/plot/DataViewerInterface.java index c7a5dcd2..1e80c814 100644 --- a/src/eva2/gui/plot/DataViewerInterface.java +++ b/src/eva2/gui/plot/DataViewerInterface.java @@ -14,7 +14,7 @@ package eva2.gui.plot; * IMPORTS *==========================================================================*/ public interface DataViewerInterface { - public Graph getNewGraph(String InfoString); + Graph getNewGraph(String InfoString); - public void init(); + void init(); } \ No newline at end of file diff --git a/src/eva2/gui/plot/InterfaceDPointWithContent.java b/src/eva2/gui/plot/InterfaceDPointWithContent.java index 2fb19fe1..2c3d9d39 100644 --- a/src/eva2/gui/plot/InterfaceDPointWithContent.java +++ b/src/eva2/gui/plot/InterfaceDPointWithContent.java @@ -7,21 +7,21 @@ import eva2.problems.InterfaceOptimizationProblem; * */ public interface InterfaceDPointWithContent { - public void setEAIndividual(AbstractEAIndividual indy); + void setEAIndividual(AbstractEAIndividual indy); - public AbstractEAIndividual getEAIndividual(); + AbstractEAIndividual getEAIndividual(); /** * This method allows you to set the according optimization problem * * @param problem InterfaceOptimizationProblem */ - public void setProblem(InterfaceOptimizationProblem problem); + void setProblem(InterfaceOptimizationProblem problem); - public InterfaceOptimizationProblem getProblem(); + InterfaceOptimizationProblem getProblem(); /** * This method allows you to draw additional data of the individual */ - public void showIndividual(); + void showIndividual(); } diff --git a/src/eva2/gui/plot/PlotInterface.java b/src/eva2/gui/plot/PlotInterface.java index e5af6029..3a845220 100644 --- a/src/eva2/gui/plot/PlotInterface.java +++ b/src/eva2/gui/plot/PlotInterface.java @@ -1,7 +1,7 @@ package eva2.gui.plot; public interface PlotInterface { - public void setConnectedPoint(double x, double y, int GraphLabel); + void setConnectedPoint(double x, double y, int GraphLabel); /** * Add two graphs to form an average graph @@ -10,25 +10,25 @@ public interface PlotInterface { * @param g2 graph object two * @param forceAdd if the graph mismatch in point counts, try to add them anyway in a useful manner. */ - public void addGraph(int g1, int g2, boolean forceAdd); + void addGraph(int g1, int g2, boolean forceAdd); - public void setUnconnectedPoint(double x, double y, int GraphLabel); + void setUnconnectedPoint(double x, double y, int GraphLabel); - public void clearAll(); + void clearAll(); - public void clearGraph(int GraphNumber); + void clearGraph(int GraphNumber); - public void setInfoString(int GraphLabel, String Info, float stroke); + void setInfoString(int GraphLabel, String Info, float stroke); - public void jump(); + void jump(); - public String getName(); + String getName(); - public int getPointCount(int graphLabel); + int getPointCount(int graphLabel); // public FunctionArea getFunctionArea(); // this is bad for RMI - public boolean isValid(); + boolean isValid(); - public void init(); + void init(); } diff --git a/src/eva2/optimization/EvAMainAdapter.java b/src/eva2/optimization/EvAMainAdapter.java index 8076a5af..8aacf250 100644 --- a/src/eva2/optimization/EvAMainAdapter.java +++ b/src/eva2/optimization/EvAMainAdapter.java @@ -16,7 +16,7 @@ import eva2.optimization.modules.ModuleAdapter; */ public interface EvAMainAdapter { - public String[] getModuleNameList(); + String[] getModuleNameList(); // returns the corresponding ModuleAdapter ModuleAdapter getModuleAdapter(String selectedModuleName); diff --git a/src/eva2/optimization/InterfaceNotifyOnInformers.java b/src/eva2/optimization/InterfaceNotifyOnInformers.java index e823b86f..c35cd388 100644 --- a/src/eva2/optimization/InterfaceNotifyOnInformers.java +++ b/src/eva2/optimization/InterfaceNotifyOnInformers.java @@ -8,5 +8,5 @@ public interface InterfaceNotifyOnInformers { /** * Notify the object about informer instances. */ - public void setInformers(List informers); + void setInformers(List informers); } diff --git a/src/eva2/optimization/individuals/AbstractEAIndividual.java b/src/eva2/optimization/individuals/AbstractEAIndividual.java index 1caaba96..e1f3e3c1 100644 --- a/src/eva2/optimization/individuals/AbstractEAIndividual.java +++ b/src/eva2/optimization/individuals/AbstractEAIndividual.java @@ -200,10 +200,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java. if (!this.mutationOperator.equals(indy.mutationOperator)) { return false; } - if (!this.crossoverOperator.equals(indy.crossoverOperator)) { - return false; - } - return true; + return this.crossoverOperator.equals(indy.crossoverOperator); } else { return false; } diff --git a/src/eva2/optimization/individuals/GAESIndividualBinaryDoubleData.java b/src/eva2/optimization/individuals/GAESIndividualBinaryDoubleData.java index cb96c613..5ac30542 100644 --- a/src/eva2/optimization/individuals/GAESIndividualBinaryDoubleData.java +++ b/src/eva2/optimization/individuals/GAESIndividualBinaryDoubleData.java @@ -61,10 +61,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme if (!((AbstractEAIndividual) this.doubleIndividual).equalGenotypes((AbstractEAIndividual) indy.doubleIndividual)) { return false; } - if (!((AbstractEAIndividual) this.binaryIndividual).equalGenotypes((AbstractEAIndividual) indy.binaryIndividual)) { - return false; - } - return true; + return ((AbstractEAIndividual) this.binaryIndividual).equalGenotypes((AbstractEAIndividual) indy.binaryIndividual); } else { return false; } diff --git a/src/eva2/optimization/individuals/GAIndividualBinaryData.java b/src/eva2/optimization/individuals/GAIndividualBinaryData.java index aba42880..2e85c3cc 100644 --- a/src/eva2/optimization/individuals/GAIndividualBinaryData.java +++ b/src/eva2/optimization/individuals/GAIndividualBinaryData.java @@ -78,10 +78,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte if ((this.genotype == null) || (indy.genotype == null)) { return false; } - if (!this.genotype.equals(indy.genotype)) { - return false; - } - return true; + return this.genotype.equals(indy.genotype); } else { return false; } diff --git a/src/eva2/optimization/individuals/GAPIndividualProgramData.java b/src/eva2/optimization/individuals/GAPIndividualProgramData.java index 3a008557..807d9a42 100644 --- a/src/eva2/optimization/individuals/GAPIndividualProgramData.java +++ b/src/eva2/optimization/individuals/GAPIndividualProgramData.java @@ -57,10 +57,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In if (!((AbstractEAIndividual) this.numberData).equalGenotypes((AbstractEAIndividual) indy.numberData)) { return false; } - if (!((AbstractEAIndividual) this.programData).equalGenotypes((AbstractEAIndividual) indy.programData)) { - return false; - } - return true; + return ((AbstractEAIndividual) this.programData).equalGenotypes((AbstractEAIndividual) indy.programData); } else { return false; } diff --git a/src/eva2/optimization/individuals/GEIndividualProgramData.java b/src/eva2/optimization/individuals/GEIndividualProgramData.java index 106199c9..fd381bc4 100644 --- a/src/eva2/optimization/individuals/GEIndividualProgramData.java +++ b/src/eva2/optimization/individuals/GEIndividualProgramData.java @@ -130,10 +130,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int if ((this.genotype == null) || (indy.genotype == null)) { return false; } - if (!this.genotype.equals(indy.genotype)) { - return false; - } - return true; + return this.genotype.equals(indy.genotype); } else { return false; } diff --git a/src/eva2/optimization/individuals/GIOBGAIndividualIntegerPermutationData.java b/src/eva2/optimization/individuals/GIOBGAIndividualIntegerPermutationData.java index 96a8371c..42bacdee 100644 --- a/src/eva2/optimization/individuals/GIOBGAIndividualIntegerPermutationData.java +++ b/src/eva2/optimization/individuals/GIOBGAIndividualIntegerPermutationData.java @@ -57,10 +57,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual if (!((AbstractEAIndividual) this.integerData).equalGenotypes((AbstractEAIndividual) indy.integerData)) { return false; } - if (!((AbstractEAIndividual) this.permutationData).equalGenotypes((AbstractEAIndividual) indy.permutationData)) { - return false; - } - return true; + return ((AbstractEAIndividual) this.permutationData).equalGenotypes((AbstractEAIndividual) indy.permutationData); } else { return false; } diff --git a/src/eva2/optimization/individuals/InterfaceDataTypeBinary.java b/src/eva2/optimization/individuals/InterfaceDataTypeBinary.java index 1444d2dd..b074fade 100644 --- a/src/eva2/optimization/individuals/InterfaceDataTypeBinary.java +++ b/src/eva2/optimization/individuals/InterfaceDataTypeBinary.java @@ -14,21 +14,21 @@ public interface InterfaceDataTypeBinary { * * @param length The lenght of the BitSet that is to be optimized */ - public void setBinaryDataLength(int length); + void setBinaryDataLength(int length); /** * This method returns the length of the binary data set * * @return The number of bits stored */ - public int size(); + int size(); /** * This method allows you to read the binary data * * @return BitSet representing the binary data. */ - public BitSet getBinaryData(); + BitSet getBinaryData(); /** * This method allows you to read the binary data without @@ -36,14 +36,14 @@ public interface InterfaceDataTypeBinary { * * @return BitSet representing the binary data. */ - public BitSet getBinaryDataWithoutUpdate(); + BitSet getBinaryDataWithoutUpdate(); /** * This method allows you to set the binary data. * * @param binaryData The new binary data. */ - public void setBinaryPhenotype(BitSet binaryData); + void setBinaryPhenotype(BitSet binaryData); /** * This method allows you to set the binary data, this can be used for @@ -51,5 +51,5 @@ public interface InterfaceDataTypeBinary { * * @param binaryData The new binary data. */ - public void setBinaryGenotype(BitSet binaryData); + void setBinaryGenotype(BitSet binaryData); } diff --git a/src/eva2/optimization/individuals/InterfaceDataTypeDouble.java b/src/eva2/optimization/individuals/InterfaceDataTypeDouble.java index 2eca7aee..5b5cd1a3 100644 --- a/src/eva2/optimization/individuals/InterfaceDataTypeDouble.java +++ b/src/eva2/optimization/individuals/InterfaceDataTypeDouble.java @@ -14,14 +14,14 @@ public interface InterfaceDataTypeDouble { * * @param length The lenght of the double[] that is to be optimized */ - public void setDoubleDataLength(int length); + void setDoubleDataLength(int length); /** * This method returns the length of the double data set * * @return The number of doubles stored */ - public int size(); + int size(); /** * This method will set the range of the double attributes. @@ -31,21 +31,21 @@ public interface InterfaceDataTypeDouble { * @param range The new range for the double data. */ @Parameter(name = "range", description = "The initialization range for the individual.") - public void setDoubleRange(double[][] range); + void setDoubleRange(double[][] range); /** * This method will return the range for all double attributes. * * @return The range array. */ - public double[][] getDoubleRange(); + double[][] getDoubleRange(); /** * This method allows you to read the double data * * @return double[] representing the double data. */ - public double[] getDoubleData(); + double[] getDoubleData(); /** * This method allows you to read the double data without @@ -53,7 +53,7 @@ public interface InterfaceDataTypeDouble { * * @return double[] representing the double data. */ - public double[] getDoubleDataWithoutUpdate(); + double[] getDoubleDataWithoutUpdate(); /** * This method allows you to set the double data, usually the phenotype data. Consider using @@ -61,7 +61,7 @@ public interface InterfaceDataTypeDouble { * * @param doubleData The new double data. */ - public void setDoublePhenotype(double[] doubleData); + void setDoublePhenotype(double[] doubleData); /** * This method allows you to set the double data, this can be used for @@ -69,5 +69,5 @@ public interface InterfaceDataTypeDouble { * * @param doubleData The new double data. */ - public void setDoubleGenotype(double[] doubleData); + void setDoubleGenotype(double[] doubleData); } diff --git a/src/eva2/optimization/individuals/InterfaceDataTypeInteger.java b/src/eva2/optimization/individuals/InterfaceDataTypeInteger.java index 3247f286..43500050 100644 --- a/src/eva2/optimization/individuals/InterfaceDataTypeInteger.java +++ b/src/eva2/optimization/individuals/InterfaceDataTypeInteger.java @@ -12,14 +12,14 @@ public interface InterfaceDataTypeInteger { * * @param length The lenght of the int[] that is to be optimized */ - public void setIntegerDataLength(int length); + void setIntegerDataLength(int length); /** * This method returns the length of the int data set * * @return The number of integers stored */ - public int size(); + int size(); /** * This method will set the range of the int attributes. @@ -28,21 +28,21 @@ public interface InterfaceDataTypeInteger { * * @param range The new range for the int data. */ - public void setIntRange(int[][] range); + void setIntRange(int[][] range); /** * This method will return the range for all int attributes. * * @return The range array. */ - public int[][] getIntRange(); + int[][] getIntRange(); /** * This method allows you to read the int data * * @return int[] representing the int data. */ - public int[] getIntegerData(); + int[] getIntegerData(); /** * This method allows you to read the int data without @@ -50,14 +50,14 @@ public interface InterfaceDataTypeInteger { * * @return int[] representing the int data. */ - public int[] getIntegerDataWithoutUpdate(); + int[] getIntegerDataWithoutUpdate(); /** * This method allows you to set the int data. * * @param intData The new int data. */ - public void setIntPhenotype(int[] intData); + void setIntPhenotype(int[] intData); /** * This method allows you to set the int data, this can be used for @@ -65,5 +65,5 @@ public interface InterfaceDataTypeInteger { * * @param intData The new int data. */ - public void setIntGenotype(int[] intData); + void setIntGenotype(int[] intData); } diff --git a/src/eva2/optimization/individuals/InterfaceDataTypePermutation.java b/src/eva2/optimization/individuals/InterfaceDataTypePermutation.java index 3c1aa1d2..a7d507fe 100644 --- a/src/eva2/optimization/individuals/InterfaceDataTypePermutation.java +++ b/src/eva2/optimization/individuals/InterfaceDataTypePermutation.java @@ -13,7 +13,7 @@ public interface InterfaceDataTypePermutation { * * @param length int new length */ - public void setPermutationDataLength(int[] length); + void setPermutationDataLength(int[] length); /** @@ -21,7 +21,7 @@ public interface InterfaceDataTypePermutation { * * @return int */ - public int[] sizePermutation(); + int[] sizePermutation(); /** * This method allows you to read the permutation data @@ -36,7 +36,7 @@ public interface InterfaceDataTypePermutation { * * @return int[] representing the permutation. */ - public int[][] getPermutationDataWithoutUpdate(); + int[][] getPermutationDataWithoutUpdate(); /** * This method allows you to set the permutation. @@ -53,5 +53,5 @@ public interface InterfaceDataTypePermutation { */ void setPermutationGenotype(int[][] perm); - public void setFirstindex(int[] firstindex); + void setFirstindex(int[] firstindex); } diff --git a/src/eva2/optimization/individuals/InterfaceDataTypeProgram.java b/src/eva2/optimization/individuals/InterfaceDataTypeProgram.java index 4d3221ac..66cd3491 100644 --- a/src/eva2/optimization/individuals/InterfaceDataTypeProgram.java +++ b/src/eva2/optimization/individuals/InterfaceDataTypeProgram.java @@ -14,14 +14,14 @@ public interface InterfaceDataTypeProgram { * * @param length The lenght of the double[] that is to be optimized */ - public void setProgramDataLength(int length); + void setProgramDataLength(int length); /** * This method allows you to read the program stored as Koza style node tree * * @return AbstractGPNode representing the binary data. */ - public InterfaceProgram[] getProgramData(); + InterfaceProgram[] getProgramData(); /** * This method allows you to read the Program data without @@ -29,33 +29,33 @@ public interface InterfaceDataTypeProgram { * * @return InterfaceProgram[] representing the Program. */ - public InterfaceProgram[] getProgramDataWithoutUpdate(); + InterfaceProgram[] getProgramDataWithoutUpdate(); /** * This method allows you to set the program. * * @param program The new program. */ - public void SetProgramPhenotype(InterfaceProgram[] program); + void SetProgramPhenotype(InterfaceProgram[] program); /** * This method allows you to set the program. * * @param program The new program. */ - public void SetProgramGenotype(InterfaceProgram[] program); + void SetProgramGenotype(InterfaceProgram[] program); /** * This method allows you to set the function area * * @param area The area contains functions and terminals */ - public void SetFunctionArea(Object[] area); + void SetFunctionArea(Object[] area); /** * This method allows you to get the function area * * @return The area contains functions and terminals */ - public Object[] getFunctionArea(); + Object[] getFunctionArea(); } diff --git a/src/eva2/optimization/individuals/InterfaceESIndividual.java b/src/eva2/optimization/individuals/InterfaceESIndividual.java index 7c439180..3e814457 100644 --- a/src/eva2/optimization/individuals/InterfaceESIndividual.java +++ b/src/eva2/optimization/individuals/InterfaceESIndividual.java @@ -12,20 +12,20 @@ public interface InterfaceESIndividual { * * @return BitSet */ - public double[] getDGenotype(); + double[] getDGenotype(); /** * This method will allow the user to set the current ES 'genotype'. * * @param b The new genotype of the Individual */ - public void setDGenotype(double[] b); + void setDGenotype(double[] b); /** * This method will return the range for all double attributes. * * @return The range array. */ - public double[][] getDoubleRange(); + double[][] getDoubleRange(); } diff --git a/src/eva2/optimization/individuals/InterfaceGAIndividual.java b/src/eva2/optimization/individuals/InterfaceGAIndividual.java index 1c3bf0aa..02f3b984 100644 --- a/src/eva2/optimization/individuals/InterfaceGAIndividual.java +++ b/src/eva2/optimization/individuals/InterfaceGAIndividual.java @@ -14,7 +14,7 @@ public interface InterfaceGAIndividual { * * @return BitSet */ - public BitSet getBGenotype(); + BitSet getBGenotype(); /** * This method will allow the user to set the current GA genotype. @@ -24,7 +24,7 @@ public interface InterfaceGAIndividual { * * @param b The new genotype of the Individual */ - public void setBGenotype(BitSet b); + void setBGenotype(BitSet b); /** * This method allows the user to read the length of the genotype. @@ -33,6 +33,6 @@ public interface InterfaceGAIndividual { * * @return The length of the genotype. */ - public int getGenotypeLength(); + int getGenotypeLength(); } diff --git a/src/eva2/optimization/individuals/InterfaceGIIndividual.java b/src/eva2/optimization/individuals/InterfaceGIIndividual.java index 1e25c69c..9b58ff68 100644 --- a/src/eva2/optimization/individuals/InterfaceGIIndividual.java +++ b/src/eva2/optimization/individuals/InterfaceGIIndividual.java @@ -12,14 +12,14 @@ public interface InterfaceGIIndividual { * * @param length The lenght of the int[] that is to be optimized */ - public void setIntegerDataLength(int length); + void setIntegerDataLength(int length); /** * This method will return the range for all int attributes. * * @return The range array. */ - public int[][] getIntRange(); + int[][] getIntRange(); /** * This method will set the range of the int attributes. @@ -28,14 +28,14 @@ public interface InterfaceGIIndividual { * * @param range The new range for the int data. */ - public void setIntRange(int[][] range); + void setIntRange(int[][] range); /** * This method will allow the user to read the GI genotype * * @return BitSet */ - public int[] getIGenotype(); + int[] getIGenotype(); /** * This method will allow the user to set the current GI genotype. @@ -45,7 +45,7 @@ public interface InterfaceGIIndividual { * * @param b The new genotype of the Individual */ - public void setIGenotype(int[] b); + void setIGenotype(int[] b); /** * This method allows the user to read the length of the genotype. @@ -54,5 +54,5 @@ public interface InterfaceGIIndividual { * * @return The length of the genotype. */ - public int getGenotypeLength(); + int getGenotypeLength(); } diff --git a/src/eva2/optimization/individuals/InterfaceGPIndividual.java b/src/eva2/optimization/individuals/InterfaceGPIndividual.java index 42230845..325114b4 100644 --- a/src/eva2/optimization/individuals/InterfaceGPIndividual.java +++ b/src/eva2/optimization/individuals/InterfaceGPIndividual.java @@ -13,14 +13,14 @@ public interface InterfaceGPIndividual { * * @return AbstractGPNode */ - public AbstractGPNode[] getPGenotype(); + AbstractGPNode[] getPGenotype(); /** * This method will allow the user to set the current program 'genotype'. * * @param b The new program genotype of the Individual */ - public void setPGenotype(AbstractGPNode[] b); + void setPGenotype(AbstractGPNode[] b); /** * This method will allow the user to set the current program 'genotype'. @@ -28,19 +28,19 @@ public interface InterfaceGPIndividual { * @param b The new program genotype of the Individual * @param i The index where to insert the new program */ - public void setPGenotype(AbstractGPNode b, int i); + void setPGenotype(AbstractGPNode b, int i); /** * This method allows you to get the function area * * @return area The area contains functions and terminals */ - public Object[] getFunctionArea(); + Object[] getFunctionArea(); /** * Return the maximal allowed depth of a GP tree (or -1 if it does not apply). * * @return */ - public int getMaxAllowedDepth(); + int getMaxAllowedDepth(); } diff --git a/src/eva2/optimization/individuals/InterfaceOBGAIndividual.java b/src/eva2/optimization/individuals/InterfaceOBGAIndividual.java index 4d06ecca..f6834623 100644 --- a/src/eva2/optimization/individuals/InterfaceOBGAIndividual.java +++ b/src/eva2/optimization/individuals/InterfaceOBGAIndividual.java @@ -13,7 +13,7 @@ public interface InterfaceOBGAIndividual { * * @return int[] genotype */ - public int[][] getOBGenotype(); + int[][] getOBGenotype(); /** @@ -21,5 +21,5 @@ public interface InterfaceOBGAIndividual { * * @param b int[] new genotype */ - public void setOBGenotype(int[][] b); + void setOBGenotype(int[][] b); } diff --git a/src/eva2/optimization/individuals/codings/ga/InterfaceGADoubleCoding.java b/src/eva2/optimization/individuals/codings/ga/InterfaceGADoubleCoding.java index cee6afae..237af487 100644 --- a/src/eva2/optimization/individuals/codings/ga/InterfaceGADoubleCoding.java +++ b/src/eva2/optimization/individuals/codings/ga/InterfaceGADoubleCoding.java @@ -17,7 +17,7 @@ public interface InterfaceGADoubleCoding { * @param correction Enable automatic correction is enabled. * @return The float value. */ - public double decodeValue(BitSet refBitSet, double[] range, int[] locus, boolean correction); + double decodeValue(BitSet refBitSet, double[] range, int[] locus, boolean correction); /** * This method codes a given double value directly into a BitSet at @@ -29,5 +29,5 @@ public interface InterfaceGADoubleCoding { * @param refBitSet The BitSet where the questioned value is stored. * @param locus The position and length on the BitSet that is to be coded. */ - public void codeValue(double value, double[] range, BitSet refBitSet, int[] locus); + void codeValue(double value, double[] range, BitSet refBitSet, int[] locus); } diff --git a/src/eva2/optimization/individuals/codings/ga/InterfaceGAIntegerCoding.java b/src/eva2/optimization/individuals/codings/ga/InterfaceGAIntegerCoding.java index 70b4a4ad..dd8fc024 100644 --- a/src/eva2/optimization/individuals/codings/ga/InterfaceGAIntegerCoding.java +++ b/src/eva2/optimization/individuals/codings/ga/InterfaceGAIntegerCoding.java @@ -18,7 +18,7 @@ public interface InterfaceGAIntegerCoding { * @param correction Enable automatic correction is enabled. * @return The float value. */ - public int decodeValue(BitSet refBitSet, int[] range, int[] locus, boolean correction); + int decodeValue(BitSet refBitSet, int[] range, int[] locus, boolean correction); /** * This method codes a given int value directly into a BitSet at @@ -30,12 +30,12 @@ public interface InterfaceGAIntegerCoding { * @param refBitSet The BitSet where the questioned value is stored. * @param locus The position and length on the BitSet that is to be coded. */ - public void codeValue(int value, int[] range, BitSet refBitSet, int[] locus); + void codeValue(int value, int[] range, BitSet refBitSet, int[] locus); /** * This method will calculate how many bits are to be used to code a given value * * @param range The range for the value. */ - public int calculateNecessaryBits(int[] range); + int calculateNecessaryBits(int[] range); } diff --git a/src/eva2/optimization/individuals/codings/gp/InterfaceProgram.java b/src/eva2/optimization/individuals/codings/gp/InterfaceProgram.java index 39c828bf..4e99c7c7 100644 --- a/src/eva2/optimization/individuals/codings/gp/InterfaceProgram.java +++ b/src/eva2/optimization/individuals/codings/gp/InterfaceProgram.java @@ -11,12 +11,12 @@ public interface InterfaceProgram { * * @param environment */ - public Object evaluate(eva2.problems.InterfaceProgramProblem environment); + Object evaluate(eva2.problems.InterfaceProgramProblem environment); /** * This method returns a string representation of the current program. * * @return string */ - public String getStringRepresentation(); + String getStringRepresentation(); } diff --git a/src/eva2/optimization/mocco/InterfaceProcessElement.java b/src/eva2/optimization/mocco/InterfaceProcessElement.java index 94cbc4da..bb9f321a 100644 --- a/src/eva2/optimization/mocco/InterfaceProcessElement.java +++ b/src/eva2/optimization/mocco/InterfaceProcessElement.java @@ -8,13 +8,13 @@ public interface InterfaceProcessElement { /** * This method will call the initialize method and will go to stall */ - public void initProcessElementParametrization(); + void initProcessElementParametrization(); /** * This method will wait for the parametrisation result * * @return int Result */ - public boolean isFinished(); + boolean isFinished(); } diff --git a/src/eva2/optimization/mocco/paretofrontviewer/InterfaceParetoFrontView.java b/src/eva2/optimization/mocco/paretofrontviewer/InterfaceParetoFrontView.java index 4aebe944..de5e8cb9 100644 --- a/src/eva2/optimization/mocco/paretofrontviewer/InterfaceParetoFrontView.java +++ b/src/eva2/optimization/mocco/paretofrontviewer/InterfaceParetoFrontView.java @@ -10,5 +10,5 @@ public interface InterfaceParetoFrontView { * the data has changed most likely due to changes in * the problem definition */ - public void updateView(); + void updateView(); } diff --git a/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefPointListener.java b/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefPointListener.java index afda2f2e..602479d6 100644 --- a/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefPointListener.java +++ b/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefPointListener.java @@ -10,5 +10,5 @@ public interface InterfaceRefPointListener { * * @param point The selected point, most likely 2d */ - public void refPointGiven(double[] point); + void refPointGiven(double[] point); } diff --git a/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefSolutionListener.java b/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefSolutionListener.java index 4592120e..3cf87b25 100644 --- a/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefSolutionListener.java +++ b/src/eva2/optimization/mocco/paretofrontviewer/InterfaceRefSolutionListener.java @@ -13,5 +13,5 @@ public interface InterfaceRefSolutionListener { * * @param indy The selected individual */ - public void individualSelected(AbstractEAIndividual indy); + void individualSelected(AbstractEAIndividual indy); } diff --git a/src/eva2/optimization/operator/archiving/ArchivingPESAII.java b/src/eva2/optimization/operator/archiving/ArchivingPESAII.java index be3a1341..63088ec0 100644 --- a/src/eva2/optimization/operator/archiving/ArchivingPESAII.java +++ b/src/eva2/optimization/operator/archiving/ArchivingPESAII.java @@ -142,11 +142,7 @@ public class ArchivingPESAII extends AbstractArchiving implements java.io.Serial sameGrid = true; for (int k = 0; k < tmpFit.length; k++) { tmpGrid[k] = (int) ((tmpFit[k] - bounds[k][0]) / grid[k]); - if (curGrid[k] == tmpGrid[k]) { - sameGrid &= true; - } else { - sameGrid &= false; - } + sameGrid &= curGrid[k] == tmpGrid[k]; } if (sameGrid) { coll.add(j); @@ -159,7 +155,7 @@ public class ArchivingPESAII extends AbstractArchiving implements java.io.Serial // now i got all the boogies of the same grid element // lets assign them their squeeze factor for (int j = 0; j < coll.size(); j++) { - result[(int) coll.get(j)] = coll.size(); + result[coll.get(j)] = coll.size(); tmpIndy = pop.get(((Integer) coll.get(j)).intValue()); tmpIndy.putData("SqueezeFactor", coll.size()); tmpIndy.putData("GridBox", curGrid); diff --git a/src/eva2/optimization/operator/archiving/InterfaceArchiving.java b/src/eva2/optimization/operator/archiving/InterfaceArchiving.java index 0cf63554..c0b586ad 100644 --- a/src/eva2/optimization/operator/archiving/InterfaceArchiving.java +++ b/src/eva2/optimization/operator/archiving/InterfaceArchiving.java @@ -12,7 +12,7 @@ public interface InterfaceArchiving { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method allows you to merge populations into an archive. @@ -21,5 +21,5 @@ public interface InterfaceArchiving { * * @param pop The population that may add Individuals to the archive. */ - public void addElementsToArchive(Population pop); + void addElementsToArchive(Population pop); } diff --git a/src/eva2/optimization/operator/archiving/InterfaceInformationRetrieval.java b/src/eva2/optimization/operator/archiving/InterfaceInformationRetrieval.java index 4a29b60b..7c9b66b7 100644 --- a/src/eva2/optimization/operator/archiving/InterfaceInformationRetrieval.java +++ b/src/eva2/optimization/operator/archiving/InterfaceInformationRetrieval.java @@ -14,7 +14,7 @@ public interface InterfaceInformationRetrieval { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method will allow Information Retrieval from a archive onto @@ -22,6 +22,6 @@ public interface InterfaceInformationRetrieval { * * @param pop The population. */ - public void retrieveInformationFrom(Population pop); + void retrieveInformationFrom(Population pop); } diff --git a/src/eva2/optimization/operator/archiving/InterfaceRemoveSurplusIndividuals.java b/src/eva2/optimization/operator/archiving/InterfaceRemoveSurplusIndividuals.java index 67431fb0..4a9f19a2 100644 --- a/src/eva2/optimization/operator/archiving/InterfaceRemoveSurplusIndividuals.java +++ b/src/eva2/optimization/operator/archiving/InterfaceRemoveSurplusIndividuals.java @@ -14,7 +14,7 @@ public interface InterfaceRemoveSurplusIndividuals { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method will remove surplus individuals @@ -22,5 +22,5 @@ public interface InterfaceRemoveSurplusIndividuals { * * @param archive */ - public void removeSurplusIndividuals(Population archive); + void removeSurplusIndividuals(Population archive); } diff --git a/src/eva2/optimization/operator/classification/InterfaceClassification.java b/src/eva2/optimization/operator/classification/InterfaceClassification.java index 2634b316..75ed3fe2 100644 --- a/src/eva2/optimization/operator/classification/InterfaceClassification.java +++ b/src/eva2/optimization/operator/classification/InterfaceClassification.java @@ -10,7 +10,7 @@ public interface InterfaceClassification { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method will initialize the classificator @@ -18,7 +18,7 @@ public interface InterfaceClassification { * @param space The double[n][d] space* * @param type The classes [0,1,..] */ - public void init(double[][] space, int[] type); + void init(double[][] space, int[] type); /** * This method allows you to train the classificator based on @@ -28,7 +28,7 @@ public interface InterfaceClassification { * @param space The double[n][d] space * @param type The int[n] classes [0,1,..] */ - public void train(double[][] space, int[] type); + void train(double[][] space, int[] type); /** * This method will classify a given data point @@ -36,5 +36,5 @@ public interface InterfaceClassification { * @param point The double[d] data point. * @return type The resulting class. */ - public int getClassFor(double[] point); + int getClassFor(double[] point); } diff --git a/src/eva2/optimization/operator/cluster/ClusteringDensityBased.java b/src/eva2/optimization/operator/cluster/ClusteringDensityBased.java index 94e22701..712d9a1c 100644 --- a/src/eva2/optimization/operator/cluster/ClusteringDensityBased.java +++ b/src/eva2/optimization/operator/cluster/ClusteringDensityBased.java @@ -180,11 +180,7 @@ public class ClusteringDensityBased implements InterfaceClusteringDistanceParam, Population tmpPop = new Population(species1.size() + species2.size()); tmpPop.addPopulation(species1); tmpPop.addPopulation(species2); - if (this.cluster(tmpPop, referencePop).length <= 2) { - return true; - } else { - return false; - } + return this.cluster(tmpPop, referencePop).length <= 2; } } diff --git a/src/eva2/optimization/operator/cluster/ClusteringKMeans.java b/src/eva2/optimization/operator/cluster/ClusteringKMeans.java index ef9a684a..7a4cf3fa 100644 --- a/src/eva2/optimization/operator/cluster/ClusteringKMeans.java +++ b/src/eva2/optimization/operator/cluster/ClusteringKMeans.java @@ -354,11 +354,7 @@ public class ClusteringKMeans implements InterfaceClustering, java.io.Serializab @Override public boolean mergingSpecies(Population species1, Population species2, Population referencePop) { // TODO i could use the BIC metric from X-means to calculate this - if (metric.distance(species1.getBestEAIndividual(), species2.getBestEAIndividual()) < mergeDist) { - return true; - } else { - return false; - } + return metric.distance(species1.getBestEAIndividual(), species2.getBestEAIndividual()) < mergeDist; } // /** This method decides if a unclustered individual belongs to an already established species. diff --git a/src/eva2/optimization/operator/cluster/ClusteringNearestBetter.java b/src/eva2/optimization/operator/cluster/ClusteringNearestBetter.java index 323ed94f..5f5773bb 100644 --- a/src/eva2/optimization/operator/cluster/ClusteringNearestBetter.java +++ b/src/eva2/optimization/operator/cluster/ClusteringNearestBetter.java @@ -374,20 +374,12 @@ public class ClusteringNearestBetter implements InterfaceClustering, Serializabl public boolean mergingSpecies(Population species1, Population species2, Population referenceSet) { getRefData(referenceSet, species1); if (testConvergingSpeciesOnBestOnly) { - if (this.metric.distance(species1.getBestEAIndividual(), species2.getBestEAIndividual()) < this.currentDistThreshold()) { - return true; - } else { - return false; - } + return this.metric.distance(species1.getBestEAIndividual(), species2.getBestEAIndividual()) < this.currentDistThreshold(); } else { Population tmpPop = new Population(species1.size() + species2.size()); tmpPop.addPopulation(species1); tmpPop.addPopulation(species2); - if (this.cluster(tmpPop, referenceSet).length <= 2) { - return true; - } else { - return false; - } + return this.cluster(tmpPop, referenceSet).length <= 2; } } diff --git a/src/eva2/optimization/operator/cluster/InterfaceClustering.java b/src/eva2/optimization/operator/cluster/InterfaceClustering.java index 8d07d1f5..3caf5e41 100644 --- a/src/eva2/optimization/operator/cluster/InterfaceClustering.java +++ b/src/eva2/optimization/operator/cluster/InterfaceClustering.java @@ -16,7 +16,7 @@ public interface InterfaceClustering { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method allows you to search for clusters in a given population. The method @@ -37,7 +37,7 @@ public interface InterfaceClustering { * @param referenceSet a reference population for dynamic measures * @return Population[] */ - public Population[] cluster(Population pop, Population referenceSet); + Population[] cluster(Population pop, Population referenceSet); /** * This method allows you to decide if two species are to be merged regarding this clustering algorithm. @@ -51,7 +51,7 @@ public interface InterfaceClustering { * @param referenceSet a reference population for dynamic measures * @return True if species converge, else False. */ - public boolean mergingSpecies(Population species1, Population species2, Population referenceSet); + boolean mergingSpecies(Population species1, Population species2, Population referenceSet); /** * Do some pre-calculations on a population for clustering. If additional population data @@ -59,7 +59,7 @@ public interface InterfaceClustering { * * @param pop */ - public String initClustering(Population pop); + String initClustering(Population pop); /** * Try to associate a set of loners with a given set of species. Return a list @@ -77,5 +77,5 @@ public interface InterfaceClustering { * @param referenceSet a reference population for dynamic measures * @return associative list matching loners to species. */ - public int[] associateLoners(Population loners, Population[] species, Population referenceSet); + int[] associateLoners(Population loners, Population[] species, Population referenceSet); } diff --git a/src/eva2/optimization/operator/cluster/InterfaceClusteringDistanceParam.java b/src/eva2/optimization/operator/cluster/InterfaceClusteringDistanceParam.java index dd38816b..9bce4ff6 100644 --- a/src/eva2/optimization/operator/cluster/InterfaceClusteringDistanceParam.java +++ b/src/eva2/optimization/operator/cluster/InterfaceClusteringDistanceParam.java @@ -6,7 +6,7 @@ package eva2.optimization.operator.cluster; * @author mkron */ public interface InterfaceClusteringDistanceParam extends InterfaceClustering { - public double getClustDistParam(); + double getClustDistParam(); - public void setClustDistParam(double param); + void setClustDistParam(double param); } diff --git a/src/eva2/optimization/operator/cluster/InterfaceClusteringMetricBased.java b/src/eva2/optimization/operator/cluster/InterfaceClusteringMetricBased.java index dc5cfc55..cfbc97bc 100644 --- a/src/eva2/optimization/operator/cluster/InterfaceClusteringMetricBased.java +++ b/src/eva2/optimization/operator/cluster/InterfaceClusteringMetricBased.java @@ -8,7 +8,7 @@ import eva2.optimization.operator.distancemetric.InterfaceDistanceMetric; * @author mkron */ public interface InterfaceClusteringMetricBased { - public InterfaceDistanceMetric getMetric(); + InterfaceDistanceMetric getMetric(); - public void setMetric(InterfaceDistanceMetric m); + void setMetric(InterfaceDistanceMetric m); } diff --git a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanLinear.java b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanLinear.java index 5eb68285..c0c04db5 100644 --- a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanLinear.java +++ b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanLinear.java @@ -41,11 +41,7 @@ public class ConstObjectivesInEqualityBiggerThanLinear implements InterfaceConst if (d.length != 2) { return true; } - if ((this.m * d[0] + this.b) < d[1]) { - return true; - } else { - return false; - } + return (this.m * d[0] + this.b) < d[1]; } } diff --git a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanSurface.java b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanSurface.java index c695b219..0664d2cd 100644 --- a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanSurface.java +++ b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityBiggerThanSurface.java @@ -38,11 +38,7 @@ public class ConstObjectivesInEqualityBiggerThanSurface implements InterfaceCons @Override public boolean isValid(AbstractEAIndividual indy) { double[] d = indy.getFitness(); - if (this.getScalarProduct(norm, this.getSubstraction(d, base)) >= 0) { - return true; - } else { - return false; - } + return this.getScalarProduct(norm, this.getSubstraction(d, base)) >= 0; } private double[] getSubstraction(double[] a, double[] b) { diff --git a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityLesserThanLinear.java b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityLesserThanLinear.java index 38f4d9f7..29a29346 100644 --- a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityLesserThanLinear.java +++ b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualityLesserThanLinear.java @@ -41,10 +41,6 @@ public class ConstObjectivesInEqualityLesserThanLinear implements InterfaceConst if (d.length != 2) { return true; } - if ((this.m * d[0] + this.b) > d[1]) { - return true; - } else { - return false; - } + return (this.m * d[0] + this.b) > d[1]; } } \ No newline at end of file diff --git a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualitySmallerThanSurface.java b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualitySmallerThanSurface.java index 849a5388..bc25be10 100644 --- a/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualitySmallerThanSurface.java +++ b/src/eva2/optimization/operator/constraint/ConstObjectivesInEqualitySmallerThanSurface.java @@ -38,11 +38,7 @@ public class ConstObjectivesInEqualitySmallerThanSurface implements InterfaceCon @Override public boolean isValid(AbstractEAIndividual indy) { double[] d = indy.getFitness(); - if (this.getScalarProduct(norm, this.getSubstraction(d, base)) < 0) { - return true; - } else { - return false; - } + return this.getScalarProduct(norm, this.getSubstraction(d, base)) < 0; } private double[] getSubstraction(double[] a, double[] b) { diff --git a/src/eva2/optimization/operator/constraint/InterfaceConstraint.java b/src/eva2/optimization/operator/constraint/InterfaceConstraint.java index 7cc6c121..79aec048 100644 --- a/src/eva2/optimization/operator/constraint/InterfaceConstraint.java +++ b/src/eva2/optimization/operator/constraint/InterfaceConstraint.java @@ -13,7 +13,7 @@ public interface InterfaceConstraint { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method allows you wether or not a given individual @@ -22,5 +22,5 @@ public interface InterfaceConstraint { * @param indy The individual to check. * @return true if valid false else. */ - public boolean isValid(AbstractEAIndividual indy); + boolean isValid(AbstractEAIndividual indy); } diff --git a/src/eva2/optimization/operator/constraint/InterfaceDoubleConstraint.java b/src/eva2/optimization/operator/constraint/InterfaceDoubleConstraint.java index f6ae1ddf..2b24b1aa 100644 --- a/src/eva2/optimization/operator/constraint/InterfaceDoubleConstraint.java +++ b/src/eva2/optimization/operator/constraint/InterfaceDoubleConstraint.java @@ -10,7 +10,7 @@ public interface InterfaceDoubleConstraint { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * Returns the boolean information whether the constraint is satisfied. @@ -18,7 +18,7 @@ public interface InterfaceDoubleConstraint { * @param indyX * @return */ - public boolean isSatisfied(double[] indyX); + boolean isSatisfied(double[] indyX); /** * Return the absolute (positive) degree of violation or zero if the constraint @@ -27,5 +27,5 @@ public interface InterfaceDoubleConstraint { * @param indyX possibly the decoded individual position * @return true if valid false else. */ - public double getViolation(double[] indyX); + double getViolation(double[] indyX); } diff --git a/src/eva2/optimization/operator/crossover/CrossoverOBGAPMX.java b/src/eva2/optimization/operator/crossover/CrossoverOBGAPMX.java index 790edac5..5cafcf60 100644 --- a/src/eva2/optimization/operator/crossover/CrossoverOBGAPMX.java +++ b/src/eva2/optimization/operator/crossover/CrossoverOBGAPMX.java @@ -86,11 +86,7 @@ public class CrossoverOBGAPMX implements InterfaceCrossover, java.io.Serializabl */ @Override public boolean equals(Object crossover) { - if (crossover instanceof CrossoverOBGAPMX) { - return true; - } else { - return false; - } + return crossover instanceof CrossoverOBGAPMX; } @Override diff --git a/src/eva2/optimization/operator/crossover/CrossoverOBGAPMXUniform.java b/src/eva2/optimization/operator/crossover/CrossoverOBGAPMXUniform.java index fbc810e9..78a1079e 100644 --- a/src/eva2/optimization/operator/crossover/CrossoverOBGAPMXUniform.java +++ b/src/eva2/optimization/operator/crossover/CrossoverOBGAPMXUniform.java @@ -84,11 +84,7 @@ public class CrossoverOBGAPMXUniform implements InterfaceCrossover, java.io.Seri */ @Override public boolean equals(Object crossover) { - if (crossover instanceof CrossoverOBGAPMXUniform) { - return true; - } else { - return false; - } + return crossover instanceof CrossoverOBGAPMXUniform; } diff --git a/src/eva2/optimization/operator/crossover/InterfaceCrossover.java b/src/eva2/optimization/operator/crossover/InterfaceCrossover.java index 95597859..3cc889a1 100644 --- a/src/eva2/optimization/operator/crossover/InterfaceCrossover.java +++ b/src/eva2/optimization/operator/crossover/InterfaceCrossover.java @@ -15,7 +15,7 @@ public interface InterfaceCrossover { * * @return The clone */ - public Object clone(); + Object clone(); /** * This method performs crossover on two individuals. Note: the genotype of the individuals @@ -24,7 +24,7 @@ public interface InterfaceCrossover { * @param indy1 The first individual * @param partners The second individual */ - public AbstractEAIndividual[] mate(AbstractEAIndividual indy1, Population partners); + AbstractEAIndividual[] mate(AbstractEAIndividual indy1, Population partners); /** * This method will allow the crossover operator to be initialized depending on the @@ -35,7 +35,7 @@ public interface InterfaceCrossover { * @param individual The individual that will be mutated. * @param opt The optimization problem. */ - public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt); + void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt); /** * This method allows you to get a string representation of the mutation @@ -43,7 +43,7 @@ public interface InterfaceCrossover { * * @return A descriptive string. */ - public String getStringRepresentation(); + String getStringRepresentation(); /** * This method allows you to evaluate wether two crossover operators @@ -52,5 +52,5 @@ public interface InterfaceCrossover { * @param crossover The other crossover operator */ @Override - public boolean equals(Object crossover); + boolean equals(Object crossover); } diff --git a/src/eva2/optimization/operator/crossover/InterfaceEvaluatingCrossoverOperator.java b/src/eva2/optimization/operator/crossover/InterfaceEvaluatingCrossoverOperator.java index a872281d..ff1d75a6 100644 --- a/src/eva2/optimization/operator/crossover/InterfaceEvaluatingCrossoverOperator.java +++ b/src/eva2/optimization/operator/crossover/InterfaceEvaluatingCrossoverOperator.java @@ -7,7 +7,7 @@ public interface InterfaceEvaluatingCrossoverOperator extends InterfaceCrossover * * @return */ - public int getEvaluations(); + int getEvaluations(); - public void resetEvaluations(); + void resetEvaluations(); } diff --git a/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java b/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java index 4f9e306f..e7428df0 100644 --- a/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java +++ b/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java @@ -16,7 +16,7 @@ public interface InterfaceDistanceMetric { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method allows you to compute the distance between two individuals. @@ -27,5 +27,5 @@ public interface InterfaceDistanceMetric { * @param indy2 The second individual. * @return double */ - public double distance(AbstractEAIndividual indy1, AbstractEAIndividual indy2); + double distance(AbstractEAIndividual indy1, AbstractEAIndividual indy2); } diff --git a/src/eva2/optimization/operator/fitnessmodifier/InterfaceFitnessModifier.java b/src/eva2/optimization/operator/fitnessmodifier/InterfaceFitnessModifier.java index 14f2f020..38dac5f5 100644 --- a/src/eva2/optimization/operator/fitnessmodifier/InterfaceFitnessModifier.java +++ b/src/eva2/optimization/operator/fitnessmodifier/InterfaceFitnessModifier.java @@ -14,6 +14,6 @@ public interface InterfaceFitnessModifier { * your problem to store the unaltered fitness somewhere else so that * you may still fetch it! */ - public void modifyFitness(Population population); + void modifyFitness(Population population); } diff --git a/src/eva2/optimization/operator/initialization/InterfaceInitialization.java b/src/eva2/optimization/operator/initialization/InterfaceInitialization.java index 09e2dd7f..ecaf78d1 100644 --- a/src/eva2/optimization/operator/initialization/InterfaceInitialization.java +++ b/src/eva2/optimization/operator/initialization/InterfaceInitialization.java @@ -20,12 +20,12 @@ public interface InterfaceInitialization { * @param indy the target individual to initialize * @param problem the problem instance under consideration */ - public void initialize(AbstractEAIndividual indy, InterfaceOptimizationProblem problem); + void initialize(AbstractEAIndividual indy, InterfaceOptimizationProblem problem); /** * A specific cloning method. * * @return */ - public InterfaceInitialization clone(); + InterfaceInitialization clone(); } diff --git a/src/eva2/optimization/operator/migration/InterfaceMigration.java b/src/eva2/optimization/operator/migration/InterfaceMigration.java index 8316fcc5..90c9cf94 100644 --- a/src/eva2/optimization/operator/migration/InterfaceMigration.java +++ b/src/eva2/optimization/operator/migration/InterfaceMigration.java @@ -16,13 +16,13 @@ public interface InterfaceMigration { /** * The ever present clone method */ - public Object clone(); + Object clone(); /** * Typically i'll need some initialization method for * every bit of code i write.... */ - public void initializeMigration(InterfaceOptimizer[] islands); + void initializeMigration(InterfaceOptimizer[] islands); /** * The migrate method can be called asychnronously or @@ -35,5 +35,5 @@ public interface InterfaceMigration { * you call getPopulation() on an island it is not a reference * to the population but a serialized copy of the population!! */ - public void migrate(InterfaceOptimizer[] islands); + void migrate(InterfaceOptimizer[] islands); } diff --git a/src/eva2/optimization/operator/moso/InterfaceMOSOConverter.java b/src/eva2/optimization/operator/moso/InterfaceMOSOConverter.java index b5ca63a1..5ad3b537 100644 --- a/src/eva2/optimization/operator/moso/InterfaceMOSOConverter.java +++ b/src/eva2/optimization/operator/moso/InterfaceMOSOConverter.java @@ -16,7 +16,7 @@ public interface InterfaceMOSOConverter { * * @return the clone */ - public Object clone(); + Object clone(); /** * This method takes a population of individuals with an array of @@ -27,7 +27,7 @@ public interface InterfaceMOSOConverter { * * @param pop The population to process. */ - public void convertMultiObjective2SingleObjective(Population pop); + void convertMultiObjective2SingleObjective(Population pop); /** * This method allows the problem to set the current output size of @@ -36,14 +36,14 @@ public interface InterfaceMOSOConverter { * * @param dim output dimension */ - public void setOutputDimension(int dim); + void setOutputDimension(int dim); /** * This method processes a single individual * * @param indy The individual to process. */ - public void convertSingleIndividual(AbstractEAIndividual indy); + void convertSingleIndividual(AbstractEAIndividual indy); /** * This method allows the CommonJavaObjectEditorPanel to read the @@ -51,12 +51,12 @@ public interface InterfaceMOSOConverter { * * @return The name. */ - public String getName(); + String getName(); /** * This method returns a description of the objective * * @return A String */ - public String getStringRepresentation(); + String getStringRepresentation(); } diff --git a/src/eva2/optimization/operator/mutation/InterfaceAdaptOperatorGenerational.java b/src/eva2/optimization/operator/mutation/InterfaceAdaptOperatorGenerational.java index 54e9f59f..ece5b609 100644 --- a/src/eva2/optimization/operator/mutation/InterfaceAdaptOperatorGenerational.java +++ b/src/eva2/optimization/operator/mutation/InterfaceAdaptOperatorGenerational.java @@ -17,7 +17,7 @@ public interface InterfaceAdaptOperatorGenerational { * @param oldPop the initial population for the developmental step * @param selectedPop the sup-population selected as parents for the new generation */ - public void adaptAfterSelection(Population oldPop, Population selectedPop); + void adaptAfterSelection(Population oldPop, Population selectedPop); /** * Perform adaption of the operator based on the developmental step performed by an EA. @@ -32,5 +32,5 @@ public interface InterfaceAdaptOperatorGenerational { * @param newPop the new population created by the EA, should already be evaluated * @param updateSelected if true, the selected population should be adapted as well */ - public void adaptGenerational(Population oldPop, Population selectedPop, Population newPop, boolean updateSelected); + void adaptGenerational(Population oldPop, Population selectedPop, Population newPop, boolean updateSelected); } diff --git a/src/eva2/optimization/operator/mutation/InterfaceMutation.java b/src/eva2/optimization/operator/mutation/InterfaceMutation.java index deb01c56..0e12183c 100644 --- a/src/eva2/optimization/operator/mutation/InterfaceMutation.java +++ b/src/eva2/optimization/operator/mutation/InterfaceMutation.java @@ -15,7 +15,7 @@ public interface InterfaceMutation { * * @return The clone */ - public Object clone(); + Object clone(); /** * This method allows you to initialize the mutation operator @@ -23,7 +23,7 @@ public interface InterfaceMutation { * @param individual The individual that will be mutated. * @param opt The optimization problem. */ - public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt); + void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt); /** * This method will mutate a given AbstractEAIndividual. If the individual @@ -31,7 +31,7 @@ public interface InterfaceMutation { * * @param individual The individual that is to be mutated */ - public void mutate(AbstractEAIndividual individual); + void mutate(AbstractEAIndividual individual); /** * This method allows you to perform either crossover on the strategy parameters @@ -40,7 +40,7 @@ public interface InterfaceMutation { * @param indy1 The original mother * @param partners The original partners */ - public void crossoverOnStrategyParameters(AbstractEAIndividual indy1, Population partners); + void crossoverOnStrategyParameters(AbstractEAIndividual indy1, Population partners); /** * This method allows you to get a string representation of the mutation @@ -48,7 +48,7 @@ public interface InterfaceMutation { * * @return A descriptive string. */ - public String getStringRepresentation(); + String getStringRepresentation(); /** * This method allows you to evaluate wether two mutation operators @@ -57,5 +57,5 @@ public interface InterfaceMutation { * @param mutator The other mutation operator */ @Override - public boolean equals(Object mutator); + boolean equals(Object mutator); } diff --git a/src/eva2/optimization/operator/nichepso/absorption/InterfaceAbsorptionStrategy.java b/src/eva2/optimization/operator/nichepso/absorption/InterfaceAbsorptionStrategy.java index 6a967591..eee45ac9 100644 --- a/src/eva2/optimization/operator/nichepso/absorption/InterfaceAbsorptionStrategy.java +++ b/src/eva2/optimization/operator/nichepso/absorption/InterfaceAbsorptionStrategy.java @@ -16,7 +16,7 @@ public interface InterfaceAbsorptionStrategy { * @return * @tested decides whether indy should be absorbed into the subswarm according to the absorption strategie */ - public abstract boolean shouldAbsorbParticleIntoSubswarm( + boolean shouldAbsorbParticleIntoSubswarm( AbstractEAIndividual indy, ParticleSubSwarmOptimization subswarm, ParticleSubSwarmOptimization mainswarm); @@ -27,10 +27,10 @@ public interface InterfaceAbsorptionStrategy { * @param mainswarm the swarm indy currently belongs to * @tested absorbs indy according to the absorbtion strategy */ - public abstract void absorbParticle( + void absorbParticle( AbstractEAIndividual indy, ParticleSubSwarmOptimization subswarm, ParticleSubSwarmOptimization mainswarm); - public abstract Object clone(); + Object clone(); } diff --git a/src/eva2/optimization/operator/nichepso/absorption/StandardAbsorptionStrategy.java b/src/eva2/optimization/operator/nichepso/absorption/StandardAbsorptionStrategy.java index 9d8dcc83..b969d1a0 100644 --- a/src/eva2/optimization/operator/nichepso/absorption/StandardAbsorptionStrategy.java +++ b/src/eva2/optimization/operator/nichepso/absorption/StandardAbsorptionStrategy.java @@ -32,10 +32,7 @@ public class StandardAbsorptionStrategy implements InterfaceAbsorptionStrategy, if (!subswarm.isActive()) { return false; // no interaction between active mainswarmparticle and inactive subswarm } - if (!particleLiesInSubswarmRadius(indy, subswarm)) { - return false; - } - return true; + return particleLiesInSubswarmRadius(indy, subswarm); } private boolean particleLiesInSubswarmRadius(AbstractEAIndividual indy, ParticleSubSwarmOptimization subswarm) { @@ -43,11 +40,7 @@ public class StandardAbsorptionStrategy implements InterfaceAbsorptionStrategy, double R = subswarm.getBoundSwarmRadius(); // uses euclidean distance AbstractEAIndividual gbest = subswarm.getGBestIndividual(); double dist = subswarm.distance(indy, gbest); // euclidean distance - if (dist <= R) { - return true; - } else { - return false; - } + return dist <= R; } diff --git a/src/eva2/optimization/operator/nichepso/deactivation/InterfaceDeactivationStrategy.java b/src/eva2/optimization/operator/nichepso/deactivation/InterfaceDeactivationStrategy.java index 25480ebe..1abb2059 100644 --- a/src/eva2/optimization/operator/nichepso/deactivation/InterfaceDeactivationStrategy.java +++ b/src/eva2/optimization/operator/nichepso/deactivation/InterfaceDeactivationStrategy.java @@ -12,7 +12,7 @@ public interface InterfaceDeactivationStrategy { * @return * @tested decides whether a subswarm should be deacitvated according to the deactivation strategy */ - public abstract boolean shouldDeactivateSubswarm(ParticleSubSwarmOptimization subswarm); + boolean shouldDeactivateSubswarm(ParticleSubSwarmOptimization subswarm); /** * @param subswarm @@ -21,8 +21,8 @@ public interface InterfaceDeactivationStrategy { * What happens to the particles in this subswarm depends on the concrete strategy. * Return the list of indices to be reinitialized or null. */ - public abstract int[] deactivateSubswarm(ParticleSubSwarmOptimization subswarm, ParticleSubSwarmOptimization mainswarm); + int[] deactivateSubswarm(ParticleSubSwarmOptimization subswarm, ParticleSubSwarmOptimization mainswarm); - public abstract Object clone(); + Object clone(); } diff --git a/src/eva2/optimization/operator/nichepso/merging/InterfaceMergingStrategy.java b/src/eva2/optimization/operator/nichepso/merging/InterfaceMergingStrategy.java index 6c3f78d7..345c2309 100644 --- a/src/eva2/optimization/operator/nichepso/merging/InterfaceMergingStrategy.java +++ b/src/eva2/optimization/operator/nichepso/merging/InterfaceMergingStrategy.java @@ -17,7 +17,7 @@ public interface InterfaceMergingStrategy { * @param subswarm2 * @return */ - public abstract boolean shouldMergeSubswarms( + boolean shouldMergeSubswarms( ParticleSubSwarmOptimization subswarm1, ParticleSubSwarmOptimization subswarm2); @@ -32,11 +32,11 @@ public interface InterfaceMergingStrategy { * @param subSwarms * @param mainSwarm */ - public abstract void mergeSubswarms( + void mergeSubswarms( int i, int j, Vector subSwarms, ParticleSubSwarmOptimization mainSwarm); - public abstract Object clone(); + Object clone(); } diff --git a/src/eva2/optimization/operator/nichepso/merging/StandardMergingStrategy.java b/src/eva2/optimization/operator/nichepso/merging/StandardMergingStrategy.java index 1cd4587b..07790211 100644 --- a/src/eva2/optimization/operator/nichepso/merging/StandardMergingStrategy.java +++ b/src/eva2/optimization/operator/nichepso/merging/StandardMergingStrategy.java @@ -54,12 +54,9 @@ public class StandardMergingStrategy implements InterfaceMergingStrategy, java.i return false; } - if (!subswarmsOverlapOrAreVeryClose(subswarm1, subswarm2)) { - return false; - } + return subswarmsOverlapOrAreVeryClose(subswarm1, subswarm2); - return true; } private boolean subswarmsOverlapOrAreVeryClose(ParticleSubSwarmOptimization subswarm1, ParticleSubSwarmOptimization subswarm2) { @@ -101,10 +98,7 @@ public class StandardMergingStrategy implements InterfaceMergingStrategy, java.i } // normalised distance //if (Ri == 0 && Rj == 0 && dist_norm < getEpsilon()){ // see "Enhancing the NichePSO" paper - if (dist_norm < getMu()) { // Ri und Rj auf null testen sinvoll ? - return true; - } - return false; + return dist_norm < getMu(); } /********************************************************************************************************************** diff --git a/src/eva2/optimization/operator/nichepso/subswarmcreation/InterfaceSubswarmCreationStrategy.java b/src/eva2/optimization/operator/nichepso/subswarmcreation/InterfaceSubswarmCreationStrategy.java index f82ad131..ba86ef6d 100644 --- a/src/eva2/optimization/operator/nichepso/subswarmcreation/InterfaceSubswarmCreationStrategy.java +++ b/src/eva2/optimization/operator/nichepso/subswarmcreation/InterfaceSubswarmCreationStrategy.java @@ -14,7 +14,7 @@ public interface InterfaceSubswarmCreationStrategy { * @return * @tested decides whether a subswarm should be created for the given indy and mainswarm according to the creation strategie */ - public abstract boolean shouldCreateSubswarm( + boolean shouldCreateSubswarm( AbstractEAIndividual indy, ParticleSubSwarmOptimization mainswarm); @@ -26,10 +26,10 @@ public interface InterfaceSubswarmCreationStrategy { * @param mainSwarm the main swarm which contains indy * @tested creates a subswarm from indy, the details depend on the concrete strategy. */ - public abstract void createSubswarm( + void createSubswarm( ParticleSubSwarmOptimization preparedSubswarm, AbstractEAIndividual indy, ParticleSubSwarmOptimization mainSwarm); - public abstract Object clone(); + Object clone(); } diff --git a/src/eva2/optimization/operator/nichepso/subswarmcreation/StandardSubswarmCreationStrategy.java b/src/eva2/optimization/operator/nichepso/subswarmcreation/StandardSubswarmCreationStrategy.java index 39554948..8c2408b8 100644 --- a/src/eva2/optimization/operator/nichepso/subswarmcreation/StandardSubswarmCreationStrategy.java +++ b/src/eva2/optimization/operator/nichepso/subswarmcreation/StandardSubswarmCreationStrategy.java @@ -48,11 +48,8 @@ public class StandardSubswarmCreationStrategy implements InterfaceSubswarmCreati // check for stddev < delta condition double stddev = (Double) indy.getData(NichePSO.stdDevKey); - if (stddev >= getDelta()) { - return false; - } + return stddev < getDelta(); - return true; } /** diff --git a/src/eva2/optimization/operator/paramcontrol/GenericParamAdaption.java b/src/eva2/optimization/operator/paramcontrol/GenericParamAdaption.java index 28e399c1..617b1f7b 100644 --- a/src/eva2/optimization/operator/paramcontrol/GenericParamAdaption.java +++ b/src/eva2/optimization/operator/paramcontrol/GenericParamAdaption.java @@ -12,5 +12,5 @@ public interface GenericParamAdaption extends ParamAdaption { * * @param prm */ - public void setControlledParam(String prm); + void setControlledParam(String prm); } diff --git a/src/eva2/optimization/operator/paramcontrol/InterfaceHasUpperDoubleBound.java b/src/eva2/optimization/operator/paramcontrol/InterfaceHasUpperDoubleBound.java index fbcfd05f..a618db5e 100644 --- a/src/eva2/optimization/operator/paramcontrol/InterfaceHasUpperDoubleBound.java +++ b/src/eva2/optimization/operator/paramcontrol/InterfaceHasUpperDoubleBound.java @@ -7,7 +7,7 @@ package eva2.optimization.operator.paramcontrol; * @author mkron */ public interface InterfaceHasUpperDoubleBound { - public double getUpperBnd(); + double getUpperBnd(); - public void SetUpperBnd(double u); + void SetUpperBnd(double u); } diff --git a/src/eva2/optimization/operator/paramcontrol/InterfaceParamControllable.java b/src/eva2/optimization/operator/paramcontrol/InterfaceParamControllable.java index ef42df5c..6a312a26 100644 --- a/src/eva2/optimization/operator/paramcontrol/InterfaceParamControllable.java +++ b/src/eva2/optimization/operator/paramcontrol/InterfaceParamControllable.java @@ -6,11 +6,11 @@ package eva2.optimization.operator.paramcontrol; * @author mkron */ public interface InterfaceParamControllable { - public void notifyParamChanged(String member, Object oldVal, Object newVal); + void notifyParamChanged(String member, Object oldVal, Object newVal); - public Object[] getParamControl(); + Object[] getParamControl(); - public void addChangeListener(ParamChangeListener l); + void addChangeListener(ParamChangeListener l); - public void removeChangeListener(ParamChangeListener l); + void removeChangeListener(ParamChangeListener l); } diff --git a/src/eva2/optimization/operator/paramcontrol/InterfaceParameterControl.java b/src/eva2/optimization/operator/paramcontrol/InterfaceParameterControl.java index 4dbbac8b..00b6bc33 100644 --- a/src/eva2/optimization/operator/paramcontrol/InterfaceParameterControl.java +++ b/src/eva2/optimization/operator/paramcontrol/InterfaceParameterControl.java @@ -24,21 +24,21 @@ public interface InterfaceParameterControl { * * @return Deep copy */ - public Object clone(); + Object clone(); /** * Initialize the parameter control instance before a run. * * @param obj The controlled object. */ - public void init(Object obj, Population initialPop); + void init(Object obj, Population initialPop); /** * After an optimization run, finalizing stuff may be done. * * @param obj The controlled object. */ - public void finish(Object obj, Population finalPop); + void finish(Object obj, Population finalPop); /** * For a given runtime (maxIteration) and current iteration, update the parameters of the object. @@ -48,7 +48,7 @@ public interface InterfaceParameterControl { * @param iteration Iteration * @param maxIteration Maximum Iteration */ - public void updateParameters(Object obj, Population pop, int iteration, int maxIteration); + void updateParameters(Object obj, Population pop, int iteration, int maxIteration); /** * If no runtime in terms of iterations can be specified, the parameter control may try to infer @@ -56,5 +56,5 @@ public interface InterfaceParameterControl { * * @param obj Object */ - public void updateParameters(Object obj); + void updateParameters(Object obj); } diff --git a/src/eva2/optimization/operator/paramcontrol/ParamAdaption.java b/src/eva2/optimization/operator/paramcontrol/ParamAdaption.java index f34d9646..8dbe5eb4 100644 --- a/src/eva2/optimization/operator/paramcontrol/ParamAdaption.java +++ b/src/eva2/optimization/operator/paramcontrol/ParamAdaption.java @@ -9,9 +9,9 @@ import eva2.optimization.population.Population; */ public interface ParamAdaption { - public Object clone(); + Object clone(); - public String getControlledParam(); + String getControlledParam(); /** * Perform the adaption. @@ -20,10 +20,10 @@ public interface ParamAdaption { * @param maxIteration * @return */ - public Object calcValue(Object obj, Population pop, int iteration, int maxIteration); + Object calcValue(Object obj, Population pop, int iteration, int maxIteration); - public void init(Object obj, Population pop, Object[] initialValues); + void init(Object obj, Population pop, Object[] initialValues); - public void finish(Object obj, Population pop); + void finish(Object obj, Population pop); } diff --git a/src/eva2/optimization/operator/paramcontrol/ParamChangeListener.java b/src/eva2/optimization/operator/paramcontrol/ParamChangeListener.java index 357e5b49..7edd279f 100644 --- a/src/eva2/optimization/operator/paramcontrol/ParamChangeListener.java +++ b/src/eva2/optimization/operator/paramcontrol/ParamChangeListener.java @@ -1,5 +1,5 @@ package eva2.optimization.operator.paramcontrol; public interface ParamChangeListener { - public void notifyChange(InterfaceParamControllable controllable, Object oldVal, Object newVal, String msg); + void notifyChange(InterfaceParamControllable controllable, Object oldVal, Object newVal, String msg); } diff --git a/src/eva2/optimization/operator/paretofrontmetrics/InterfaceParetoFrontMetric.java b/src/eva2/optimization/operator/paretofrontmetrics/InterfaceParetoFrontMetric.java index 6ca873be..c1816211 100644 --- a/src/eva2/optimization/operator/paretofrontmetrics/InterfaceParetoFrontMetric.java +++ b/src/eva2/optimization/operator/paretofrontmetrics/InterfaceParetoFrontMetric.java @@ -13,11 +13,11 @@ public interface InterfaceParetoFrontMetric { * * @return the clone */ - public Object clone(); + Object clone(); /** * This method gives a metirc how to evaluate * an achieved Pareto-Front */ - public double calculateMetricOn(Population pop, AbstractMultiObjectiveOptimizationProblem problem); + double calculateMetricOn(Population pop, AbstractMultiObjectiveOptimizationProblem problem); } diff --git a/src/eva2/optimization/operator/postprocess/InterfacePostProcessParams.java b/src/eva2/optimization/operator/postprocess/InterfacePostProcessParams.java index 7abe05f5..b767204e 100644 --- a/src/eva2/optimization/operator/postprocess/InterfacePostProcessParams.java +++ b/src/eva2/optimization/operator/postprocess/InterfacePostProcessParams.java @@ -11,37 +11,37 @@ import eva2.optimization.enums.PostProcessMethod; * @author mkron */ public interface InterfacePostProcessParams { - public int getPostProcessSteps(); + int getPostProcessSteps(); - public void setPostProcessSteps(int ppSteps); + void setPostProcessSteps(int ppSteps); - public String postProcessStepsTipText(); + String postProcessStepsTipText(); - public boolean isDoPostProcessing(); + boolean isDoPostProcessing(); - public void setDoPostProcessing(boolean postProcess); + void setDoPostProcessing(boolean postProcess); - public String doPostProcessingTipText(); + String doPostProcessingTipText(); - public double getPostProcessClusterSigma(); + double getPostProcessClusterSigma(); - public void setPostProcessClusterSigma(double postProcessClusterSigma); + void setPostProcessClusterSigma(double postProcessClusterSigma); - public String postProcessClusterSigmaTipText(); + String postProcessClusterSigmaTipText(); - public int getPrintNBest(); + int getPrintNBest(); - public void setPrintNBest(int nBest); + void setPrintNBest(int nBest); - public String printNBestTipText(); + String printNBestTipText(); - public void setPPMethod(PostProcessMethod meth); + void setPPMethod(PostProcessMethod meth); - public PostProcessMethod getPPMethod(); + PostProcessMethod getPPMethod(); - public String PPMethodTipText(); + String PPMethodTipText(); - public boolean isWithPlot(); + boolean isWithPlot(); - public void setWithPlot(boolean withPlot); + void setWithPlot(boolean withPlot); } diff --git a/src/eva2/optimization/operator/selection/InterfaceSelection.java b/src/eva2/optimization/operator/selection/InterfaceSelection.java index 36d17081..a5a01db9 100644 --- a/src/eva2/optimization/operator/selection/InterfaceSelection.java +++ b/src/eva2/optimization/operator/selection/InterfaceSelection.java @@ -21,7 +21,7 @@ public interface InterfaceSelection { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method allows an selection method to do some preliminary @@ -31,7 +31,7 @@ public interface InterfaceSelection { * * @param population The population that is to be processed. */ - public void prepareSelection(Population population); + void prepareSelection(Population population); /** * This method will select >size< individuals from the given @@ -41,7 +41,7 @@ public interface InterfaceSelection { * @param size The number of Individuals to select * @return The selected population. */ - public Population selectFrom(Population population, int size); + Population selectFrom(Population population, int size); /** * This method allows you to select >size< partners for a given Individual @@ -51,7 +51,7 @@ public interface InterfaceSelection { * @param size The number of partners needed. * @return The selected partners. */ - public Population findPartnerFor(AbstractEAIndividual dad, Population availablePartners, int size); + Population findPartnerFor(AbstractEAIndividual dad, Population availablePartners, int size); /** * Toggle the use of obeying the constraint violation principle @@ -59,5 +59,5 @@ public interface InterfaceSelection { * * @param b The new state */ - public void setObeyDebsConstViolationPrinciple(boolean b); + void setObeyDebsConstViolationPrinciple(boolean b); } diff --git a/src/eva2/optimization/operator/selection/probability/InterfaceSelectionProbability.java b/src/eva2/optimization/operator/selection/probability/InterfaceSelectionProbability.java index 439976e6..d9a98649 100644 --- a/src/eva2/optimization/operator/selection/probability/InterfaceSelectionProbability.java +++ b/src/eva2/optimization/operator/selection/probability/InterfaceSelectionProbability.java @@ -16,7 +16,7 @@ public interface InterfaceSelectionProbability { * * @return the deep clone */ - public Object clone(); + Object clone(); /** * This method computes the selection probability for each individual @@ -26,7 +26,7 @@ public interface InterfaceSelectionProbability { * @param population The population to compute. * @param input The name of the input. */ - public void computeSelectionProbability(Population population, String[] input, boolean obeyConst); + void computeSelectionProbability(Population population, String[] input, boolean obeyConst); /** * This method computes the selection probability for each individual @@ -36,7 +36,7 @@ public interface InterfaceSelectionProbability { * @param population The population to compute. * @param input The name of the input. */ - public void computeSelectionProbability(Population population, String input, boolean obeyConst); + void computeSelectionProbability(Population population, String input, boolean obeyConst); /** * This method computes the selection probability for each individual @@ -46,5 +46,5 @@ public interface InterfaceSelectionProbability { * @param population The population to compute. * @param data The input data as double[][]. */ - public void computeSelectionProbability(Population population, double[][] data, boolean obeyConst); + void computeSelectionProbability(Population population, double[][] data, boolean obeyConst); } diff --git a/src/eva2/optimization/operator/selection/replacement/InterfaceReplacement.java b/src/eva2/optimization/operator/selection/replacement/InterfaceReplacement.java index e6af90c5..895c8683 100644 --- a/src/eva2/optimization/operator/selection/replacement/InterfaceReplacement.java +++ b/src/eva2/optimization/operator/selection/replacement/InterfaceReplacement.java @@ -11,7 +11,7 @@ public interface InterfaceReplacement { /** * The ever present clone method */ - public Object clone(); + Object clone(); /** * This method will insert the given individual into the population @@ -22,5 +22,5 @@ public interface InterfaceReplacement { * @param pop The population * @param sub The subset */ - public void insertIndividual(AbstractEAIndividual indy, Population pop, Population sub); + void insertIndividual(AbstractEAIndividual indy, Population pop, Population sub); } diff --git a/src/eva2/optimization/operator/terminators/InterfaceTerminator.java b/src/eva2/optimization/operator/terminators/InterfaceTerminator.java index 431b91fc..22db31d5 100644 --- a/src/eva2/optimization/operator/terminators/InterfaceTerminator.java +++ b/src/eva2/optimization/operator/terminators/InterfaceTerminator.java @@ -14,14 +14,14 @@ public interface InterfaceTerminator { * @param pop the population to test * @return true if the population fulfills the termination criterion, else false */ - public boolean isTerminated(PopulationInterface pop); + boolean isTerminated(PopulationInterface pop); - public boolean isTerminated(InterfaceSolutionSet pop); + boolean isTerminated(InterfaceSolutionSet pop); @Override - public String toString(); + String toString(); - public String lastTerminationMessage(); + String lastTerminationMessage(); - public void initialize(InterfaceOptimizationProblem prob); + void initialize(InterfaceOptimizationProblem prob); } \ No newline at end of file diff --git a/src/eva2/optimization/population/InterfaceSolutionSet.java b/src/eva2/optimization/population/InterfaceSolutionSet.java index 5edffd89..bc6bb83f 100644 --- a/src/eva2/optimization/population/InterfaceSolutionSet.java +++ b/src/eva2/optimization/population/InterfaceSolutionSet.java @@ -9,9 +9,9 @@ package eva2.optimization.population; * @author mkron */ public interface InterfaceSolutionSet { - public Population getSolutions(); + Population getSolutions(); - public Population getCurrentPopulation(); + Population getCurrentPopulation(); - public SolutionSet clone(); + SolutionSet clone(); } diff --git a/src/eva2/optimization/statistics/InterfaceStatisticsListener.java b/src/eva2/optimization/statistics/InterfaceStatisticsListener.java index c15cf140..4bbcec09 100644 --- a/src/eva2/optimization/statistics/InterfaceStatisticsListener.java +++ b/src/eva2/optimization/statistics/InterfaceStatisticsListener.java @@ -18,7 +18,7 @@ public interface InterfaceStatisticsListener { * @param statObjects * @param statDoubles */ - public void notifyGenerationPerformed(String[] header, Object[] statObjects, Double[] statDoubles); + void notifyGenerationPerformed(String[] header, Object[] statObjects, Double[] statDoubles); /** * Method called at the start of a single run. @@ -28,7 +28,7 @@ public interface InterfaceStatisticsListener { * @param header field names of the data * @param metaInfo additional meta information on the data fields */ - public void notifyRunStarted(int runNumber, int plannedMultiRuns, String[] header, String[] metaInfo); + void notifyRunStarted(int runNumber, int plannedMultiRuns, String[] header, String[] metaInfo); /** * Method called at the end of a single run. @@ -36,7 +36,7 @@ public interface InterfaceStatisticsListener { * @param runsPerformed the number of runs performed * @param completedLastRun true, if the last run was stopped normally, otherwise false, e.g. indicating a user break */ - public void notifyRunStopped(int runsPerformed, boolean completedLastRun); + void notifyRunStopped(int runsPerformed, boolean completedLastRun); /** * Receive the list of last data lines for a set of multiruns. The data list may be null if no runs were @@ -47,7 +47,7 @@ public interface InterfaceStatisticsListener { * @see InterfaceStatisticsParameters * @see AbstractStatistics */ - public void finalMultiRunResults(String[] header, List multiRunFinalObjectData); + void finalMultiRunResults(String[] header, List multiRunFinalObjectData); /** * Called after the job is finished. Return true if the listener should be removed after this multi-run. @@ -55,5 +55,5 @@ public interface InterfaceStatisticsListener { * @param header * @param multiRunFinalObjectData */ - public boolean notifyMultiRunFinished(String[] header, List multiRunFinalObjectData); + boolean notifyMultiRunFinished(String[] header, List multiRunFinalObjectData); } diff --git a/src/eva2/optimization/statistics/InterfaceStatisticsParameters.java b/src/eva2/optimization/statistics/InterfaceStatisticsParameters.java index 2f15f556..02002068 100644 --- a/src/eva2/optimization/statistics/InterfaceStatisticsParameters.java +++ b/src/eva2/optimization/statistics/InterfaceStatisticsParameters.java @@ -62,7 +62,7 @@ public interface InterfaceStatisticsParameters { OutputTo getOutputTo(); - public enum OutputVerbosity { + enum OutputVerbosity { NONE, FINAL, KTH_IT, ALL; @Override @@ -77,7 +77,7 @@ public interface InterfaceStatisticsParameters { } } - public enum OutputTo { + enum OutputTo { FILE, WINDOW, BOTH; public String toString() { diff --git a/src/eva2/optimization/statistics/InterfaceTextListener.java b/src/eva2/optimization/statistics/InterfaceTextListener.java index 2871b855..b7fb9b47 100644 --- a/src/eva2/optimization/statistics/InterfaceTextListener.java +++ b/src/eva2/optimization/statistics/InterfaceTextListener.java @@ -6,7 +6,7 @@ package eva2.optimization.statistics; * @author mkron */ public interface InterfaceTextListener { - public void print(String str); + void print(String str); - public void println(String str); + void println(String str); } diff --git a/src/eva2/optimization/strategies/InterfaceSpeciesAware.java b/src/eva2/optimization/strategies/InterfaceSpeciesAware.java index b2092821..641f7249 100644 --- a/src/eva2/optimization/strategies/InterfaceSpeciesAware.java +++ b/src/eva2/optimization/strategies/InterfaceSpeciesAware.java @@ -10,9 +10,9 @@ import eva2.optimization.population.Population; */ public interface InterfaceSpeciesAware { // these can be used to tag a population as explorer or local search population. - public final static String populationTagKey = "specAwarePopulationTag"; - public final static Integer explorerPopTag = 23; - public final static Integer localPopTag = 42; + String populationTagKey = "specAwarePopulationTag"; + Integer explorerPopTag = 23; + Integer localPopTag = 42; /** * Two species have been merged to the first one. @@ -20,7 +20,7 @@ public interface InterfaceSpeciesAware { * @param p1 * @param p2 */ - public void mergeToFirstPopulationEvent(Population p1, Population p2); + void mergeToFirstPopulationEvent(Population p1, Population p2); /** * Notify that a split has occurred separating p2 from p1. @@ -28,5 +28,5 @@ public interface InterfaceSpeciesAware { * @param p1 * @param p2 */ - public void splitFromFirst(Population p1, Population p2); + void splitFromFirst(Population p1, Population p2); } diff --git a/src/eva2/problems/F8Problem.java b/src/eva2/problems/F8Problem.java index 7c02ab73..54a4b20a 100644 --- a/src/eva2/problems/F8Problem.java +++ b/src/eva2/problems/F8Problem.java @@ -253,11 +253,7 @@ public class F8Problem extends AbstractProblemDoubleOffset } else { // the number of optima is corret - now check different offset or rotation by comparing one fitness value AbstractEAIndividual indy = listOfOptima.getEAIndividual(1); double[] curFit = evaluate(indy.getDoublePosition()); - if (Math.abs(Mathematics.dist(curFit, indy.getFitness(), 2)) > 1e-10) { - return true; - } else { - return false; - } + return Math.abs(Mathematics.dist(curFit, indy.getFitness(), 2)) > 1e-10; } } diff --git a/src/eva2/problems/Interface2DBorderProblem.java b/src/eva2/problems/Interface2DBorderProblem.java index 8191dcbc..790d1376 100644 --- a/src/eva2/problems/Interface2DBorderProblem.java +++ b/src/eva2/problems/Interface2DBorderProblem.java @@ -12,7 +12,7 @@ public interface Interface2DBorderProblem { * * @return double[][] */ - public double[][] get2DBorder(); + double[][] get2DBorder(); /** * This method returns the double value at a given position. The value should be @@ -21,7 +21,7 @@ public interface Interface2DBorderProblem { * @param point The double[2] that is queried. * @return double */ - public double functionValue(double[] point); + double functionValue(double[] point); /** * Project a 2D point to the default higher-dimensional cut to be displayed (if required for plotting). @@ -29,5 +29,5 @@ public interface Interface2DBorderProblem { * @param point the double[2] that is queried * @return a (higher dimensional) projection of the point */ - public double[] project2DPoint(double[] point); + double[] project2DPoint(double[] point); } diff --git a/src/eva2/problems/InterfaceAdditionalPopulationInformer.java b/src/eva2/problems/InterfaceAdditionalPopulationInformer.java index 22671f17..0b513c3b 100644 --- a/src/eva2/problems/InterfaceAdditionalPopulationInformer.java +++ b/src/eva2/problems/InterfaceAdditionalPopulationInformer.java @@ -14,14 +14,14 @@ public interface InterfaceAdditionalPopulationInformer { * * @return String */ - public String[] getAdditionalDataHeader(); + String[] getAdditionalDataHeader(); /** * Optionally return informative descriptions of the data fields. * * @return */ - public String[] getAdditionalDataInfo(); + String[] getAdditionalDataInfo(); /** * This method returns additional statistical data. @@ -29,5 +29,5 @@ public interface InterfaceAdditionalPopulationInformer { * @param pop The population that is to be refined. * @return String */ - public Object[] getAdditionalDataValue(PopulationInterface pop); + Object[] getAdditionalDataValue(PopulationInterface pop); } diff --git a/src/eva2/problems/InterfaceFirstOrderDerivableProblem.java b/src/eva2/problems/InterfaceFirstOrderDerivableProblem.java index 468a94ad..5cae19a9 100644 --- a/src/eva2/problems/InterfaceFirstOrderDerivableProblem.java +++ b/src/eva2/problems/InterfaceFirstOrderDerivableProblem.java @@ -15,7 +15,7 @@ public interface InterfaceFirstOrderDerivableProblem { * @param x * @return the first order gradients of this problem */ - public double[] getFirstOrderGradients(double[] x); + double[] getFirstOrderGradients(double[] x); // public double getFirstOrderGradient(int paramindex,double[] x); } diff --git a/src/eva2/problems/InterfaceHasInitRange.java b/src/eva2/problems/InterfaceHasInitRange.java index e0de17f7..7317e9ac 100644 --- a/src/eva2/problems/InterfaceHasInitRange.java +++ b/src/eva2/problems/InterfaceHasInitRange.java @@ -16,5 +16,5 @@ public interface InterfaceHasInitRange { * * @return An initial search range or null in case it is equal to the global search range. */ - public Object getInitializationRange(); + Object getInitializationRange(); } diff --git a/src/eva2/problems/InterfaceHasSolutionViewer.java b/src/eva2/problems/InterfaceHasSolutionViewer.java index 2433a4d9..2634b4ac 100644 --- a/src/eva2/problems/InterfaceHasSolutionViewer.java +++ b/src/eva2/problems/InterfaceHasSolutionViewer.java @@ -6,5 +6,5 @@ package eva2.problems; * @author mkron */ public interface InterfaceHasSolutionViewer { - public InterfaceSolutionViewer getSolutionViewer(); + InterfaceSolutionViewer getSolutionViewer(); } diff --git a/src/eva2/problems/InterfaceInterestingHistogram.java b/src/eva2/problems/InterfaceInterestingHistogram.java index a929ce04..2cdbfb51 100644 --- a/src/eva2/problems/InterfaceInterestingHistogram.java +++ b/src/eva2/problems/InterfaceInterestingHistogram.java @@ -13,5 +13,5 @@ public interface InterfaceInterestingHistogram { * * @return */ - public SolutionHistogram getHistogram(); + SolutionHistogram getHistogram(); } diff --git a/src/eva2/problems/InterfaceLocalSearchable.java b/src/eva2/problems/InterfaceLocalSearchable.java index eeca5fdd..63d33090 100644 --- a/src/eva2/problems/InterfaceLocalSearchable.java +++ b/src/eva2/problems/InterfaceLocalSearchable.java @@ -12,12 +12,12 @@ public interface InterfaceLocalSearchable extends InterfaceOptimizationProblem { * * @param pop */ - public void doLocalSearch(Population pop); + void doLocalSearch(Population pop); /** * Estimate the cost of one local search step -- more precisely the cost of the doLocalSearch call per one individual. * * @return */ - public double getLocalSearchStepFunctionCallEquivalent(); + double getLocalSearchStepFunctionCallEquivalent(); } diff --git a/src/eva2/problems/InterfaceMultiObjectiveDeNovoProblem.java b/src/eva2/problems/InterfaceMultiObjectiveDeNovoProblem.java index 164c902c..15580c7e 100644 --- a/src/eva2/problems/InterfaceMultiObjectiveDeNovoProblem.java +++ b/src/eva2/problems/InterfaceMultiObjectiveDeNovoProblem.java @@ -15,7 +15,7 @@ public interface InterfaceMultiObjectiveDeNovoProblem { * * @return A list of optimization objectives */ - public InterfaceOptimizationObjective[] getProblemObjectives(); + InterfaceOptimizationObjective[] getProblemObjectives(); /** * This method will generate a problem specific view on the Pareto @@ -24,12 +24,12 @@ public interface InterfaceMultiObjectiveDeNovoProblem { * * @return the Panel */ - public InterfaceParetoFrontView getParetoFrontViewer4MOCCO(MOCCOViewer t); + InterfaceParetoFrontView getParetoFrontViewer4MOCCO(MOCCOViewer t); /** * This method allows MOCCO to deactivate the representation editior * if and only if the specific editor reacts to this signal. This signal * cannot be deactivated! */ - public void deactivateRepresentationEdit(); + void deactivateRepresentationEdit(); } diff --git a/src/eva2/problems/InterfaceMultimodalProblemKnown.java b/src/eva2/problems/InterfaceMultimodalProblemKnown.java index f88d8ea1..5d6438b2 100644 --- a/src/eva2/problems/InterfaceMultimodalProblemKnown.java +++ b/src/eva2/problems/InterfaceMultimodalProblemKnown.java @@ -17,14 +17,14 @@ public interface InterfaceMultimodalProblemKnown extends InterfaceMultimodalProb * if possible and to return quality measures like NumberOfOptimaFound and * the MaximumPeakRatio. This method should be called by the user. */ - public void initListOfOptima(); + void initListOfOptima(); /** * Return true if the full list of optima is available, else false. * * @return */ - public boolean fullListAvailable(); + boolean fullListAvailable(); /** * This method returns a list of all optima as population or null if @@ -32,7 +32,7 @@ public interface InterfaceMultimodalProblemKnown extends InterfaceMultimodalProb * * @return population */ - public Population getRealOptima(); + Population getRealOptima(); /** * Return the number of identified optima or -1 if @@ -41,7 +41,7 @@ public interface InterfaceMultimodalProblemKnown extends InterfaceMultimodalProb * @param pop A population of possible solutions. * @return int */ - public int getNumberOfFoundOptima(Population pop); + int getNumberOfFoundOptima(Population pop); /** * This method returns the Maximum Peak Ratio. @@ -49,7 +49,7 @@ public interface InterfaceMultimodalProblemKnown extends InterfaceMultimodalProb * @param pop A population of possible solutions. * @return double */ - public double getMaximumPeakRatio(Population pop); + double getMaximumPeakRatio(Population pop); /** * Return the maximum normed distance to a known optimum for which the @@ -57,5 +57,5 @@ public interface InterfaceMultimodalProblemKnown extends InterfaceMultimodalProb * * @return */ - public double getDefaultAccuracy(); + double getDefaultAccuracy(); } diff --git a/src/eva2/problems/InterfaceOptimizationObjective.java b/src/eva2/problems/InterfaceOptimizationObjective.java index 674cde5b..85140d39 100644 --- a/src/eva2/problems/InterfaceOptimizationObjective.java +++ b/src/eva2/problems/InterfaceOptimizationObjective.java @@ -4,21 +4,21 @@ package eva2.problems; * */ public interface InterfaceOptimizationObjective { - public Object clone(); + Object clone(); /** * This Method returns the name for the optimization target * * @return the name */ - public String getName(); + String getName(); /** * This method allows you to retrieve the name of the optimization target * * @return The name */ - public String getIdentName(); + String getIdentName(); /** * This method allows you to retrieve the current optimization mode @@ -30,28 +30,28 @@ public interface InterfaceOptimizationObjective { * * @return The mode as string */ - public String getOptimizationMode(); + String getOptimizationMode(); - public void SetOptimizationMode(String d); + void SetOptimizationMode(String d); /** * This method allows you to retrieve the constraint/goal * * @return The cosntraint/goal */ - public double getConstraintGoal(); + double getConstraintGoal(); /** * This method allows you to set the constraint/goal * * @param d the constraint/goal */ - public void SetConstraintGoal(double d); + void SetConstraintGoal(double d); /** * This method returns whether or not the given objective is to be minimized * * @return True if to be minimized false else. */ - public boolean is2BMinimized(); + boolean is2BMinimized(); } diff --git a/src/eva2/problems/InterfaceOptimizationProblem.java b/src/eva2/problems/InterfaceOptimizationProblem.java index d95a4517..48435e57 100644 --- a/src/eva2/problems/InterfaceOptimizationProblem.java +++ b/src/eva2/problems/InterfaceOptimizationProblem.java @@ -16,12 +16,12 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * * @return the clone */ - public Object clone(); + Object clone(); /** * This method initializes the Problem to log multiruns */ - public void initializeProblem(); + void initializeProblem(); /** * This method will report whether or not this optimization problem is truly @@ -29,14 +29,14 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * * @return True if multi-objective, else false. */ - public boolean isMultiObjective(); + boolean isMultiObjective(); /** * This method initialized a given population * * @param population The populations that is to be initialized. */ - public void initializePopulation(Population population); + void initializePopulation(Population population); /** * This method evaluates a given population and sets the fitness values @@ -44,14 +44,14 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * * @param population The population that is to be evaluated. */ - public void evaluate(Population population); + void evaluate(Population population); /** * This method evaluate a single individual and sets the fitness values * * @param individual The individual that is to be evalutated */ - public void evaluate(AbstractEAIndividual individual); + void evaluate(AbstractEAIndividual individual); /** * This method allows the GenericObjectEditorPanel to read the @@ -59,7 +59,7 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * * @return The name. */ - public String getName(); + String getName(); /** * This method allows you to output a string that describes a found solution @@ -68,7 +68,7 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * @param individual The individual that is to be shown. * @return The description. */ - public String getSolutionRepresentationFor(AbstractEAIndividual individual); + String getSolutionRepresentationFor(AbstractEAIndividual individual); /** * This method returns a string describing the optimization problem. @@ -76,13 +76,13 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * @param opt The Optimizer that is used or had been used. * @return The description. */ - public String getStringRepresentationForProblem(InterfaceOptimizer opt); + String getStringRepresentationForProblem(InterfaceOptimizer opt); /** * This method allows you to request a graphical representation for a given * individual. */ - public JComponent drawIndividual(int generation, int funCalls, AbstractEAIndividual indy); + JComponent drawIndividual(int generation, int funCalls, AbstractEAIndividual indy); /** * This method returns a double value that will be displayed in a fitness @@ -92,12 +92,12 @@ public interface InterfaceOptimizationProblem extends InterfaceAdditionalPopulat * @param pop The population that is to be refined. * @return Double value */ - public Double getDoublePlotValue(Population pop); + Double getDoublePlotValue(Population pop); /** * This method returns the dimension of the problem. Some problem implementations * may add a setProblemDimension() method, but as some problems have a fixed problem * dimension this is not added in this interface. */ - public int getProblemDimension(); + int getProblemDimension(); } diff --git a/src/eva2/problems/InterfaceOptimizationTarget.java b/src/eva2/problems/InterfaceOptimizationTarget.java index d23632c0..87033142 100644 --- a/src/eva2/problems/InterfaceOptimizationTarget.java +++ b/src/eva2/problems/InterfaceOptimizationTarget.java @@ -5,12 +5,12 @@ package eva2.problems; */ public interface InterfaceOptimizationTarget { - public Object clone(); + Object clone(); /** * This method allows you to retrieve the name of the optimization target * * @return The name */ - public String getName(); + String getName(); } diff --git a/src/eva2/problems/InterfaceProblemDouble.java b/src/eva2/problems/InterfaceProblemDouble.java index b7690b71..45163bfd 100644 --- a/src/eva2/problems/InterfaceProblemDouble.java +++ b/src/eva2/problems/InterfaceProblemDouble.java @@ -13,21 +13,21 @@ public interface InterfaceProblemDouble { * @param x the vector to evaluate * @return the target function value */ - public double[] evaluate(double[] x); + double[] evaluate(double[] x); /** * Create a new range array by using the getRangeLowerBound and getRangeUpperBound methods. * * @return a range array */ - public double[][] makeRange(); + double[][] makeRange(); /** * Get the EA individual template currently used by the problem. * * @return the EA individual template currently used */ - public InterfaceDataTypeDouble getEAIndividual(); + InterfaceDataTypeDouble getEAIndividual(); /** * Get the upper bound of the double range in the given dimension. Override @@ -38,7 +38,7 @@ public interface InterfaceProblemDouble { * @see #makeRange() * @see #getRangeLowerBound(int dim) */ - public double getRangeUpperBound(int dim); + double getRangeUpperBound(int dim); /** * Get the lower bound of the double range in the given dimension. Override @@ -49,5 +49,5 @@ public interface InterfaceProblemDouble { * @see #makeRange() * @see #getRangeUpperBound(int dim) */ - public double getRangeLowerBound(int dim); + double getRangeLowerBound(int dim); } diff --git a/src/eva2/problems/InterfaceProgramProblem.java b/src/eva2/problems/InterfaceProgramProblem.java index edb10f43..76f6ce88 100644 --- a/src/eva2/problems/InterfaceProgramProblem.java +++ b/src/eva2/problems/InterfaceProgramProblem.java @@ -14,7 +14,7 @@ public interface InterfaceProgramProblem extends InterfaceOptimizationProblem { * @param sensor The identifier for the sensor. * @return Sensor value */ - public Object getSensorValue(String sensor); + Object getSensorValue(String sensor); /** * This method allows a GP program to act in the environment @@ -22,12 +22,12 @@ public interface InterfaceProgramProblem extends InterfaceOptimizationProblem { * @param actuator The identifier for the actuator. * @param parameter The actuator parameter. */ - public void setActuatorValue(String actuator, Object parameter); + void setActuatorValue(String actuator, Object parameter); /** * Return the GPArea associated with the program problem. * * @return */ - public GPArea getArea(); + GPArea getArea(); } diff --git a/src/eva2/problems/InterfaceSolutionViewer.java b/src/eva2/problems/InterfaceSolutionViewer.java index c5439634..bcb1da2e 100644 --- a/src/eva2/problems/InterfaceSolutionViewer.java +++ b/src/eva2/problems/InterfaceSolutionViewer.java @@ -13,17 +13,17 @@ public interface InterfaceSolutionViewer { * * @param prob */ - public void initView(AbstractOptimizationProblem prob); + void initView(AbstractOptimizationProblem prob); /** * Reset the view. */ - public void resetView(); + void resetView(); /** * Update the view by displaying a population of solutions (often only the best one is shown). * * @param pop */ - public void updateView(Population pop, boolean showAllIfPossible); + void updateView(Population pop, boolean showAllIfPossible); } diff --git a/src/eva2/problems/regression/InterfaceRegressionFunction.java b/src/eva2/problems/regression/InterfaceRegressionFunction.java index 81f33f40..987be519 100644 --- a/src/eva2/problems/regression/InterfaceRegressionFunction.java +++ b/src/eva2/problems/regression/InterfaceRegressionFunction.java @@ -9,7 +9,7 @@ public interface InterfaceRegressionFunction { * * @return The clone. */ - public Object clone(); + Object clone(); /** * This method will return the y value for a given x vector @@ -17,5 +17,5 @@ public interface InterfaceRegressionFunction { * @param x Input vector. * @return y the function result. */ - public double evaluateFunction(double[] x); + double evaluateFunction(double[] x); } diff --git a/src/eva2/problems/simple/InterfaceSimpleProblem.java b/src/eva2/problems/simple/InterfaceSimpleProblem.java index 4c419518..a9f48b22 100644 --- a/src/eva2/problems/simple/InterfaceSimpleProblem.java +++ b/src/eva2/problems/simple/InterfaceSimpleProblem.java @@ -13,14 +13,14 @@ public interface InterfaceSimpleProblem { * @param x a double vector to be evaluated * @return the fitness vector assigned to x as to the target function */ - public double[] evaluate(T x); + double[] evaluate(T x); /** * Return the problem dimension. * * @return the problem dimension */ - public int getProblemDimension(); + int getProblemDimension(); } diff --git a/src/eva2/tools/SelectedTag.java b/src/eva2/tools/SelectedTag.java index 70806cb6..80be45c9 100644 --- a/src/eva2/tools/SelectedTag.java +++ b/src/eva2/tools/SelectedTag.java @@ -170,12 +170,8 @@ public class SelectedTag implements java.io.Serializable { SelectedTag s = (SelectedTag) o; - if ((s.getTags() == tags) && - (s.getSelectedTag() == tags[selectedId])) { - return true; - } else { - return false; - } + return (s.getTags() == tags) && + (s.getSelectedTag() == tags[selectedId]); } /**