diff --git a/.codacy.yml b/.codacy.yml new file mode 100644 index 00000000..283e92f4 --- /dev/null +++ b/.codacy.yml @@ -0,0 +1,5 @@ +--- +exclude_paths: + - 'opt4j-viewer/src/main/java/ptolemy/**/*' + - '**/*.py' + - '**/*.js' \ No newline at end of file diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/dtlz/DTLZModule.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/dtlz/DTLZModule.java index 87b6dc36..dfc3def3 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/dtlz/DTLZModule.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/dtlz/DTLZModule.java @@ -304,7 +304,7 @@ public void config() { creator = BinaryCreator.class; decoder = BinaryToDoubleDecoder.class; break; - case DOUBLE: + default: // DOUBLE creator = DoubleCreator.class; decoder = DoubleCopyDecoder.class; break; @@ -334,6 +334,7 @@ public void config() { break; default: evaluator = DTLZ1.class; + break; } bindConstant(N.class).to(n); diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/knapsack/KnapsackModule.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/knapsack/KnapsackModule.java index d3d4639b..7ec57e11 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/knapsack/KnapsackModule.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/knapsack/KnapsackModule.java @@ -27,8 +27,9 @@ import org.opt4j.core.start.Constant; /** - * The multiobjective 0/1 ILP knapsack problem as proposed in Zitzler and Thiele 1999. Either one of the nine benchmark - * problems from Zitzler and Thiele 1999 can be selected or the number of knapsacks and items can be set manually. + * The multiobjective 0/1 ILP knapsack problem as proposed in Zitzler and Thiele + * 1999. Either one of the nine benchmark problems from Zitzler and Thiele 1999 + * can be selected or the number of knapsacks and items can be set manually. * * @see http://www.tik.ee.ethz.ch/sop/download/supplementary/testProblemSuite/ @@ -130,7 +131,7 @@ protected void config() { } switch (representation) { - case BITSTRING: + default: // BITSTRING bindProblem(KnapsackBinaryCreatorDecoder.class, KnapsackBinaryCreatorDecoder.class, KnapsackProfitEvaluator.class); break; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensErrorEvaluator.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensErrorEvaluator.java index 8ea832da..cab00ea8 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensErrorEvaluator.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensErrorEvaluator.java @@ -20,7 +20,6 @@ * SOFTWARE. *******************************************************************************/ - package org.opt4j.benchmarks.queens; import static org.opt4j.core.Objective.Sign.MIN; @@ -82,6 +81,22 @@ public Objectives evaluate(QueensBoard queensBoard) { */ private int countErrors(QueensBoard queensBoard) { int errorcount = 0; + + errorcount += countErrorsRowsColumns(queensBoard); + errorcount += countErrorsDiagonals(queensBoard); + + return errorcount; + } + + /** + * Helper function to count the errors in rows and columns. + * + * @param queensBoard + * the board + * @return the error count in rows and columns + */ + protected int countErrorsRowsColumns(QueensBoard queensBoard) { + int errorcount = 0; int size = problem.size(); for (int i = 0; i < size; i++) { @@ -106,6 +121,20 @@ private int countErrors(QueensBoard queensBoard) { errorcount += sum; } + return errorcount; + } + + /** + * Helper function to count the errors in diagonals. + * + * @param queensBoard + * the board + * @return the error count in diagonals + */ + protected int countErrorsDiagonals(QueensBoard queensBoard) { + int errorcount = 0; + int size = problem.size(); + for (int k = -size + 1; k < size; k++) { // diagonal 1 int sum = 0; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensModule.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensModule.java index 969c8309..66a5a30c 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensModule.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensModule.java @@ -63,13 +63,6 @@ public class QueensModule extends ProblemModule { @Order(3) protected Dec decoder = Dec.SAT; - /** - * Constructs a {@link QueensModule}. - */ - public QueensModule() { - super(); - } - /** * The {@link Decoder} strategy for the queens problem. * @@ -105,7 +98,7 @@ public void config() { Class> decoderClass = null; switch (decoder) { - case SAT: + default: // SAT creatorClass = QueensSATDecoder.class; decoderClass = QueensSATDecoder.class; break; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensSATDecoder.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensSATDecoder.java index a0e04ade..571a1884 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensSATDecoder.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/queens/QueensSATDecoder.java @@ -19,7 +19,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. *******************************************************************************/ - package org.opt4j.benchmarks.queens; @@ -90,7 +89,20 @@ public QueensBoard convertModel(Model model) { @Override public Set createConstraints() { Set constraints = new HashSet(); + + constraints.addAll(createConstraintsRowsColumns()); + constraints.addAll(createConstraintsDiagonal()); + return constraints; + } + + /** + * Helper function for createConstraints() that creates the constraints regarding rows and columns. + * + * @return constraints regarding rows and columns + */ + protected Set createConstraintsRowsColumns() { int size = problem.size(); + Set constraints = new HashSet(); for (int i = 0; i < size; i++) { @@ -112,6 +124,19 @@ public Set createConstraints() { constraints.add(constraint); } + return constraints; + + } + + /** + * Helper function for createConstraints() that creates the constraints regarding diagonals. + * + * @return constraints regarding diagonals + */ + protected Set createConstraintsDiagonal() { + int size = problem.size(); + Set constraints = new HashSet(); + for (int k = -size + 1; k < size; k++) { // diagonal 1 Constraint constraint = new Constraint("<=", 1); @@ -137,5 +162,6 @@ public Set createConstraints() { } return constraints; + } } diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG1.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG1.java index 1df65bcb..463c7ff6 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG1.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG1.java @@ -66,7 +66,7 @@ protected static List t1(final List y, final int k) { } for (int i = k; i < n; i++) { - t.add(WFGTransFunctions.s_linear(y.get(i), 0.35)); + t.add(WFGTransFunctions.sLinear(y.get(i), 0.35)); } return t; @@ -85,7 +85,7 @@ protected static List t2(final List y, final int k) { } for (int i = k; i < n; i++) { - t.add(WFGTransFunctions.b_flat(y.get(i), 0.8, 0.75, 0.85)); + t.add(WFGTransFunctions.bFlat(y.get(i), 0.8, 0.75, 0.85)); } return t; @@ -96,7 +96,7 @@ protected static List t3(final List y) { List t = new ArrayList(); for (int i = 0; i < n; i++) { - t.add(WFGTransFunctions.b_poly(y.get(i), 0.02)); + t.add(WFGTransFunctions.bPoly(y.get(i), 0.02)); } return t; @@ -125,13 +125,13 @@ protected static List t4(final List y, final int k, final int M) final List y_sub = y.subList(head, tail); final List w_sub = w.subList(head, tail); - t.add(WFGTransFunctions.r_sum(y_sub, w_sub)); + t.add(WFGTransFunctions.rSum(y_sub, w_sub)); } final List y_sub = y.subList(k, n); final List w_sub = w.subList(k, n); - t.add(WFGTransFunctions.r_sum(y_sub, w_sub)); + t.add(WFGTransFunctions.rSum(y_sub, w_sub)); return t; } diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG2.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG2.java index 78cb7289..9f1b9764 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG2.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG2.java @@ -70,7 +70,7 @@ protected static List t2(final List y, final int k) { final int head = k + 2 * (i - k) - 2; final int tail = k + 2 * (i - k); - t.add(WFGTransFunctions.r_nonsep(y.subList(head, tail), 2)); + t.add(WFGTransFunctions.rNonsep(y.subList(head, tail), 2)); } return t; @@ -98,13 +98,13 @@ protected static List t3(final List y, final int k, final int M) final List y_sub = y.subList(head, tail); final List w_sub = w.subList(head, tail); - t.add(WFGTransFunctions.r_sum(y_sub, w_sub)); + t.add(WFGTransFunctions.rSum(y_sub, w_sub)); } final List y_sub = y.subList(k, n); final List w_sub = w.subList(k, n); - t.add(WFGTransFunctions.r_sum(y_sub, w_sub)); + t.add(WFGTransFunctions.rSum(y_sub, w_sub)); return t; } diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG4.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG4.java index 18b26a49..b8626ef2 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG4.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG4.java @@ -58,7 +58,7 @@ public static List t1(final List y) { List t = new ArrayList(); for (int i = 0; i < n; i++) { - t.add(WFGTransFunctions.s_multi(y.get(i), 30, 10, 0.35)); + t.add(WFGTransFunctions.sMulti(y.get(i), 30, 10, 0.35)); } return t; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG5.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG5.java index 00b980ca..dff7f264 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG5.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG5.java @@ -58,7 +58,7 @@ protected static List t1(final List y) { List t = new ArrayList(); for (int i = 0; i < n; i++) { - t.add(WFGTransFunctions.s_decept(y.get(i), 0.35, 0.001, 0.05)); + t.add(WFGTransFunctions.sDecept(y.get(i), 0.35, 0.001, 0.05)); } return t; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG6.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG6.java index f0149505..d995b2d7 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG6.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG6.java @@ -68,12 +68,12 @@ public static List t2(final List y, final int k, final int M) { final List y_sub = y.subList(head, tail); - t.add(WFGTransFunctions.r_nonsep(y_sub, k / (M - 1))); + t.add(WFGTransFunctions.rNonsep(y_sub, k / (M - 1))); } final List y_sub = y.subList(k, n); - t.add(WFGTransFunctions.r_nonsep(y_sub, n - k)); + t.add(WFGTransFunctions.rNonsep(y_sub, n - k)); return t; } diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG7.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG7.java index 3f193cf5..f4f79cd5 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG7.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG7.java @@ -69,9 +69,9 @@ public static List t1(final List y, final int k) { final List y_sub = y.subList(i + 1, n); final List w_sub = w.subList(i + 1, n); - final double u = WFGTransFunctions.r_sum(y_sub, w_sub); + final double u = WFGTransFunctions.rSum(y_sub, w_sub); - t.add(WFGTransFunctions.b_param(y.get(i), u, 0.98 / 49.98, 0.02, 50)); + t.add(WFGTransFunctions.bParam(y.get(i), u, 0.98 / 49.98, 0.02, 50)); } for (int i = k; i < n; i++) { diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG8.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG8.java index 438bc178..f15d48ce 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG8.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG8.java @@ -73,9 +73,9 @@ protected static List t1(final List y, final int k) { final List y_sub = y.subList(0, i); final List w_sub = w.subList(0, i); - final double u = WFGTransFunctions.r_sum(y_sub, w_sub); + final double u = WFGTransFunctions.rSum(y_sub, w_sub); - t.add(WFGTransFunctions.b_param(y.get(i), u, 0.98 / 49.98, 0.02, 50)); + t.add(WFGTransFunctions.bParam(y.get(i), u, 0.98 / 49.98, 0.02, 50)); } return t; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG9.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG9.java index 67601c7b..220dcc1c 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG9.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFG9.java @@ -66,9 +66,9 @@ protected static List t1(final List y) { final List y_sub = y.subList(i + 1, n); final List w_sub = w.subList(i + 1, n); - final double u = WFGTransFunctions.r_sum(y_sub, w_sub); + final double u = WFGTransFunctions.rSum(y_sub, w_sub); - t.add(WFGTransFunctions.b_param(y.get(i), u, 0.98 / 49.98, 0.02, 50)); + t.add(WFGTransFunctions.bParam(y.get(i), u, 0.98 / 49.98, 0.02, 50)); } t.add(y.get(n - 1)); @@ -85,11 +85,11 @@ protected static List t2(final List y, final int k) { List t = new ArrayList(); for (int i = 0; i < k; i++) { - t.add(WFGTransFunctions.s_decept(y.get(i), 0.35, 0.001, 0.05)); + t.add(WFGTransFunctions.sDecept(y.get(i), 0.35, 0.001, 0.05)); } for (int i = k; i < n; i++) { - t.add(WFGTransFunctions.s_multi(y.get(i), 30, 95, 0.35)); + t.add(WFGTransFunctions.sMulti(y.get(i), 30, 95, 0.35)); } return t; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGEvaluator.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGEvaluator.java index 67c9582a..0a5c0e57 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGEvaluator.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGEvaluator.java @@ -109,7 +109,7 @@ protected static List calculateF(final List x, final List normalizeZ(final List z, final List z_max) { @@ -146,7 +146,7 @@ protected static List calculateX(final List t_p, final List caculateF(final List x, final List h, final List S) { + protected static List calculateF(final List x, final List h, final List S) { assert (x.size() == h.size()); assert (h.size() == S.size()); diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI1.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI1.java index 3c76cd8e..7acf523a 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI1.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI1.java @@ -80,7 +80,7 @@ protected static List shape(final List t_p) { S.add(1.0); } - return caculateF(x, h, S); + return calculateF(x, h, S); } /* diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI3.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI3.java index 115f5849..b34ca313 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI3.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGI3.java @@ -68,9 +68,9 @@ public static List t1(final List y) { final List y_sub = y.subList(0, i); final List w_sub = w.subList(0, i); - final double u = WFGTransFunctions.r_sum(y_sub, w_sub); + final double u = WFGTransFunctions.rSum(y_sub, w_sub); - t.add(WFGTransFunctions.b_param(y.get(i), u, 0.98 / 49.98, 0.02, 50)); + t.add(WFGTransFunctions.bParam(y.get(i), u, 0.98 / 49.98, 0.02, 50)); } return t; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGModule.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGModule.java index 1228c356..b5672108 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGModule.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGModule.java @@ -304,7 +304,7 @@ public void config() { Class> evaluator = null; switch (encoding) { - case BINARY: + default: //BINARY creator = BinaryCreator.class; decoder = BinaryToDoubleDecoder.class; break; diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGTransFunctions.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGTransFunctions.java index 47b09962..53a2edb5 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGTransFunctions.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/wfg/WFGTransFunctions.java @@ -59,7 +59,7 @@ public static double corretToZeroOne(final double a) { } - public static double b_poly(final double y, final double alpha) { + public static double bPoly(final double y, final double alpha) { assert (y >= 0.0); assert (y <= 1.0); assert (alpha > 0.0); @@ -75,7 +75,7 @@ public static double b_poly(final double y, final double alpha) { return result; } - public static double b_flat(final double y, final double A, final double B, final double C) { + public static double bFlat(final double y, final double A, final double B, final double C) { assert (y >= 0.0); assert (y <= 1.0); assert (A >= 0.0); @@ -103,7 +103,7 @@ public static double b_flat(final double y, final double A, final double B, fina return result; } - public static double b_param(final double y, final double u, final double A, final double B, final double C) { + public static double bParam(final double y, final double u, final double A, final double B, final double C) { assert (y >= 0.0); assert (y <= 1.0); assert (u >= 0.0); @@ -125,7 +125,7 @@ public static double b_param(final double y, final double u, final double A, fin return result; } - public static double s_linear(final double y, final double A) { + public static double sLinear(final double y, final double A) { assert (y >= 0.0); assert (y <= 1.0); assert (A > 0.0); @@ -141,7 +141,7 @@ public static double s_linear(final double y, final double A) { return result; } - public static double s_decept(final double y, final double A, final double B, final double C) { + public static double sDecept(final double y, final double A, final double B, final double C) { assert (y >= 0.0); assert (y <= 1.0); assert (A > 0.0); @@ -166,7 +166,7 @@ public static double s_decept(final double y, final double A, final double B, fi return result; } - public static double s_multi(final double y, final double A, final double B, final double C) { + public static double sMulti(final double y, final double A, final double B, final double C) { assert (y >= 0.0); assert (y <= 1.0); assert (A >= 1); @@ -188,7 +188,7 @@ public static double s_multi(final double y, final double A, final double B, fin return result; } - public static double r_sum(final List y, final List w) { + public static double rSum(final List y, final List w) { assert (!y.isEmpty()); assert (w.size() == y.size()); @@ -212,7 +212,7 @@ public static double r_sum(final List y, final List w) { return result; } - public static double r_nonsep(final List y, final int A) { + public static double rNonsep(final List y, final int A) { final int y_len = y.size(); assert (y_len != 0); diff --git a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/zdt/ZDTModule.java b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/zdt/ZDTModule.java index de02bc73..1d638697 100644 --- a/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/zdt/ZDTModule.java +++ b/opt4j-benchmarks/src/main/java/org/opt4j/benchmarks/zdt/ZDTModule.java @@ -194,6 +194,7 @@ public void setFunction(Function function) { break; default: n = 30; + break; } } @@ -254,6 +255,15 @@ public void config() { creator = DoubleCreator.class; decoder = DoubleCopyDecoder.class; break; + default: + if (function == Function.ZDT5) { + creator = ZDT5BinaryCreator.class; + decoder = BinaryCopyDecoder.class; + } else { + creator = BinaryCreator.class; + decoder = BinaryToDoubleDecoder.class; + } + break; } switch (function) { diff --git a/opt4j-core/src/main/java/org/opt4j/core/Genotype.java b/opt4j-core/src/main/java/org/opt4j/core/Genotype.java index 2d312b6a..6054d7e3 100644 --- a/opt4j-core/src/main/java/org/opt4j/core/Genotype.java +++ b/opt4j-core/src/main/java/org/opt4j/core/Genotype.java @@ -20,7 +20,6 @@ * SOFTWARE. *******************************************************************************/ - package org.opt4j.core; /** diff --git a/opt4j-core/src/main/java/org/opt4j/core/Objective.java b/opt4j-core/src/main/java/org/opt4j/core/Objective.java index 65895cc5..3591ada4 100644 --- a/opt4j-core/src/main/java/org/opt4j/core/Objective.java +++ b/opt4j-core/src/main/java/org/opt4j/core/Objective.java @@ -172,9 +172,7 @@ public boolean equals(Object obj) { return false; } else if (!name.equals(other.name)) return false; - if (sign != other.sign) - return false; - return true; + return sign == other.sign; } } diff --git a/opt4j-core/src/main/java/org/opt4j/core/common/archive/PopulationArchive.java b/opt4j-core/src/main/java/org/opt4j/core/common/archive/PopulationArchive.java index 97d4eb57..3311516e 100644 --- a/opt4j-core/src/main/java/org/opt4j/core/common/archive/PopulationArchive.java +++ b/opt4j-core/src/main/java/org/opt4j/core/common/archive/PopulationArchive.java @@ -19,7 +19,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. *******************************************************************************/ - package org.opt4j.core.common.archive; @@ -52,7 +51,8 @@ public boolean update(Set individuals) { List candidates = new ArrayList(individuals); - Objectives o1, o2; + Objectives o1; + Objectives o2; for (int i = 0; i < candidates.size() - 1; i++) { o1 = candidates.get(i).getObjectives(); for (int j = i + 1; j < candidates.size(); j++) { diff --git a/opt4j-core/src/main/java/org/opt4j/core/common/archive/UnboundedArchive.java b/opt4j-core/src/main/java/org/opt4j/core/common/archive/UnboundedArchive.java index d54e2bf2..52c48a1a 100644 --- a/opt4j-core/src/main/java/org/opt4j/core/common/archive/UnboundedArchive.java +++ b/opt4j-core/src/main/java/org/opt4j/core/common/archive/UnboundedArchive.java @@ -20,7 +20,6 @@ * SOFTWARE. *******************************************************************************/ - package org.opt4j.core.common.archive; import java.util.Collection; @@ -38,19 +37,11 @@ @Singleton public class UnboundedArchive extends AbstractArchive { - /** - * Constructs a new archive of unbounded size. - */ - public UnboundedArchive() { - super(); - } - /* * (non-Javadoc) * - * @see - * org.opt4j.common.archive.AbstractArchive#addNondominated(java.util.Collection - * ) + * @see org.opt4j.common.archive.AbstractArchive#addNondominated(java.util. + * Collection ) */ @Override protected boolean updateWithNondominated(Collection candidates) { diff --git a/opt4j-core/src/main/java/org/opt4j/core/common/random/MTRandom.java b/opt4j-core/src/main/java/org/opt4j/core/common/random/MTRandom.java index 4898a775..4ead244d 100644 --- a/opt4j-core/src/main/java/org/opt4j/core/common/random/MTRandom.java +++ b/opt4j-core/src/main/java/org/opt4j/core/common/random/MTRandom.java @@ -32,8 +32,8 @@ *

* A Java implementation of the MT19937 (Mersenne Twister) pseudo random * number generator algorithm based upon the original C code by Makoto - * Matsumoto and Takuji Nishimura (see + * Matsumoto and Takuji Nishimura (see + * * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for more * information. *

@@ -50,21 +50,21 @@ * and should not be used for cryptographic systems or in any * other situation where true random numbers are required. *

- * CC-GNU LGPL
- * This software is licensed under the CC-GNU LGPL. - * + * + * +
+ * This software is licensed under the + * CC-GNU + * LGPL. * - *