Skip to content

Commit f9057bc

Browse files
committed
Update for v5
1 parent faf1479 commit f9057bc

23 files changed

+76
-86
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.moeaframework.benchmark.NativeCProvider

ext/native/NativeC/META-INF/services/org.moeaframework.problem.ProblemProvider

Lines changed: 0 additions & 1 deletion
This file was deleted.

ext/native/NativeC/src/org/moeaframework/benchmark/NativeC.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.moeaframework.benchmark;
22

33
import org.moeaframework.core.Solution;
4-
import org.moeaframework.core.variable.EncodingUtils;
54
import org.moeaframework.core.variable.RealVariable;
65
import org.moeaframework.problem.AbstractProblem;
76

@@ -21,14 +20,14 @@ public NativeC() {
2120
}
2221

2322
public void evaluate(Solution solution) {
24-
double[] vars = EncodingUtils.getReal(solution);
23+
double[] vars = RealVariable.getReal(solution);
2524
double[] objs = new double[numberOfObjectives];
2625
double[] constrs = new double[numberOfConstraints];
2726

2827
INSTANCE.evaluate(vars, objs, constrs);
2928

30-
solution.setObjectives(objs);
31-
solution.setConstraints(constrs);
29+
solution.setObjectiveValues(objs);
30+
solution.setConstraintValues(constrs);
3231
}
3332

3433
public Solution newSolution() {

ext/native/NativeC/src/org/moeaframework/benchmark/NativeCDirectMapping.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.moeaframework.benchmark;
22

33
import org.moeaframework.core.Solution;
4-
import org.moeaframework.core.variable.EncodingUtils;
54
import org.moeaframework.core.variable.RealVariable;
65
import org.moeaframework.problem.AbstractProblem;
76

@@ -21,14 +20,14 @@ public NativeCDirectMapping() {
2120
}
2221

2322
public void evaluate(Solution solution) {
24-
double[] vars = EncodingUtils.getReal(solution);
23+
double[] vars = RealVariable.getReal(solution);
2524
double[] objs = new double[numberOfObjectives];
2625
double[] constrs = new double[numberOfConstraints];
2726

2827
evaluate(vars, objs, constrs);
2928

30-
solution.setObjectives(objs);
31-
solution.setConstraints(constrs);
29+
solution.setObjectiveValues(objs);
30+
solution.setConstraintValues(constrs);
3231
}
3332

3433
public Solution newSolution() {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.moeaframework.benchmark.NativeCPPProvider

ext/native/NativeCPP/META-INF/services/org.moeaframework.problem.ProblemProvider

Lines changed: 0 additions & 1 deletion
This file was deleted.

ext/native/NativeCPP/src/org/moeaframework/benchmark/Example.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.moeaframework.benchmark;
22

33
import org.moeaframework.algorithm.NSGAII;
4-
import org.moeaframework.core.Problem;
4+
import org.moeaframework.problem.Problem;
55

66
public class Example {
77

ext/native/NativeCPP/src/org/moeaframework/benchmark/NativeCPP.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.moeaframework.benchmark;
22

33
import org.moeaframework.core.Solution;
4-
import org.moeaframework.core.variable.EncodingUtils;
54
import org.moeaframework.core.variable.RealVariable;
65
import org.moeaframework.problem.AbstractProblem;
76

@@ -21,14 +20,14 @@ public NativeCPP() {
2120
}
2221

2322
public void evaluate(Solution solution) {
24-
double[] vars = EncodingUtils.getReal(solution);
23+
double[] vars = RealVariable.getReal(solution);
2524
double[] objs = new double[numberOfObjectives];
2625
double[] constrs = new double[numberOfConstraints];
2726

2827
INSTANCE.evaluate(vars, objs, constrs);
2928

30-
solution.setObjectives(objs);
31-
solution.setConstraints(constrs);
29+
solution.setObjectiveValues(objs);
30+
solution.setConstraintValues(constrs);
3231
}
3332

3433
public Solution newSolution() {

ext/native/NativeCPP/src/org/moeaframework/benchmark/NativeCPPDirectMapping.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.moeaframework.benchmark;
22

33
import org.moeaframework.core.Solution;
4-
import org.moeaframework.core.variable.EncodingUtils;
54
import org.moeaframework.core.variable.RealVariable;
65
import org.moeaframework.problem.AbstractProblem;
76

@@ -21,14 +20,14 @@ public NativeCPPDirectMapping() {
2120
}
2221

2322
public void evaluate(Solution solution) {
24-
double[] vars = EncodingUtils.getReal(solution);
23+
double[] vars = RealVariable.getReal(solution);
2524
double[] objs = new double[numberOfObjectives];
2625
double[] constrs = new double[numberOfConstraints];
2726

2827
evaluate(vars, objs, constrs);
2928

30-
solution.setObjectives(objs);
31-
solution.setConstraints(constrs);
29+
solution.setObjectiveValues(objs);
30+
solution.setConstraintValues(constrs);
3231
}
3332

3433
public Solution newSolution() {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.moeaframework.benchmark.NativeFortranProvider

0 commit comments

Comments
 (0)