Cleanup as well as moving TipText methods to useful @Parameter

annotations.
This commit is contained in:
Fabian Becker 2014-11-02 16:10:57 +01:00
parent 6bb4616763
commit 173ebd67c6
5 changed files with 12 additions and 16 deletions

View File

@ -1,5 +1,7 @@
package eva2.optimization.individuals; package eva2.optimization.individuals;
import eva2.util.annotation.Parameter;
/** /**
* This interface gives access to a double phenotype and except * This interface gives access to a double phenotype and except
* for problemspecific operators should only be used by the * for problemspecific operators should only be used by the
@ -28,6 +30,7 @@ public interface InterfaceDataTypeDouble {
* *
* @param range The new range for the double data. * @param range The new range for the double data.
*/ */
@Parameter(name = "range", description = "The initialization range for the individual.")
public void setDoubleRange(double[][] range); public void setDoubleRange(double[][] range);
/** /**

View File

@ -1422,7 +1422,7 @@ public class ParticleSwarmOptimization extends AbstractOptimizer implements java
/** /**
* Randomly assign groups of size groupSize. * Randomly assign groups of size groupSize.
* *
* @param links * @param pop
* @param groupSize * @param groupSize
*/ */
private Vector<int[]> regroupSwarm(Population pop, int groupSize) { private Vector<int[]> regroupSwarm(Population pop, int groupSize) {
@ -1680,7 +1680,7 @@ public class ParticleSwarmOptimization extends AbstractOptimizer implements java
/** /**
* This method allows you to choose the topology type. * This method allows you to choose the topology type.
* *
* @param s The type. * @param t The type.
*/ */
public void setTopology(PSOTopology t) { public void setTopology(PSOTopology t) {
this.topology = t; this.topology = t;

View File

@ -274,9 +274,7 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
* @return * @return
*/ */
public static Matrix initializeDefaultRotationMatrix(double rotAngle, int dim) { public static Matrix initializeDefaultRotationMatrix(double rotAngle, int dim) {
Matrix rotation = null; return Mathematics.getRotationMatrix((rotAngle * Math.PI / 180.), dim).transpose();
rotation = Mathematics.getRotationMatrix((rotAngle * Math.PI / 180.), dim).transpose();
return rotation;
} }
/** /**
@ -498,28 +496,22 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
return constraintArray; return constraintArray;
} }
@Parameter(description = "Add constraints to the problem.")
public void setConstraints(AbstractConstraint[] constrArray) { public void setConstraints(AbstractConstraint[] constrArray) {
this.constraintArray = constrArray; this.constraintArray = constrArray;
} }
public String constraintsTipText() {
return "Add constraints to the problem.";
}
public boolean isWithConstraints() { public boolean isWithConstraints() {
return withConstraints; return withConstraints;
} }
@Parameter(description = "(De-)Activate constraints for the problem.")
public void setWithConstraints(boolean withConstraints) { public void setWithConstraints(boolean withConstraints) {
this.withConstraints = withConstraints; this.withConstraints = withConstraints;
GenericObjectEditor.setShowProperty(this.getClass(), "constraints", GenericObjectEditor.setShowProperty(this.getClass(), "constraints",
withConstraints); withConstraints);
} }
public String withConstraintsTipText() {
return "(De-)Activate constraints for the problem.";
}
@Override @Override
public String[] getAdditionalDataHeader() { public String[] getAdditionalDataHeader() {
String[] superHeader = super.getAdditionalDataHeader(); String[] superHeader = super.getAdditionalDataHeader();

View File

@ -13,8 +13,7 @@ public final class ToolBox {
/** /**
* Private constructor to prevent instances of module class. * Private constructor to prevent instances of module class.
*/ */
private ToolBox() { private ToolBox() {}
}
/** /**
* Convert all items of an enum to a String array and append the given String array at the end. * Convert all items of an enum to a String array and append the given String array at the end.

View File

@ -10,7 +10,9 @@ import eva2.tools.math.interpolation.SplineInterpolation;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
public class Mathematics { public final class Mathematics {
private Mathematics() {}
/** /**
* Computes the full adjoint matrix. * Computes the full adjoint matrix.
* *