Skip to content

Commit 3bf5f97

Browse files
committed
Enable debugging mode on LRGV and WDS
1 parent 136939f commit 3bf5f97

File tree

12 files changed

+72
-3
lines changed

12 files changed

+72
-3
lines changed

native/LRGV/src/lrgv_main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ int main(int argc, char **argv)
248248
{
249249
MOEA_Read_doubles(nvars,vars); //first read the solution
250250

251+
// TODO: Remove
252+
MOEA_Debug("Vars: %lf %lf %lf %lf %lf %lf %lf %lf\n", vars[0], vars[1], vars[2], vars[3], vars[4], vars[5], vars[6], vars[7]);
253+
251254
//If the mode is 'combined' you need to run the drought scenario.
252255
//Otherwise, you can skip it. NOTE we should probably check that if
253256
//drtranscost is listed as an objective, or one of the other 'dr'
@@ -267,6 +270,10 @@ int main(int argc, char **argv)
267270
calc_LRGV(vars, objs, consts, local_calcparam);
268271
}
269272

273+
// TODO: Remove
274+
MOEA_Debug("Objs: %lf %lf %lf %lf %lf %lf\n", objs[0], objs[1], objs[2], objs[3], objs[4], objs[5]);
275+
MOEA_Debug("Constrs: %lf %lf %lf %lf %lf\n", consts[0], consts[1], consts[2], consts[3]);
276+
270277
MOEA_Write(objs, consts);
271278
//cerr << "Just calculated" << endl;
272279
}

src/main/java/org/moeaframework/benchmarks/LRGV.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public class LRGV extends ExternalProblem {
3535
public LRGV() {
3636
super(new Builder()
3737
.withCommand(SystemUtils.IS_OS_WINDOWS ? "lrgv.exe" : "lrgv", "-m", "std-io", "-b", "AllDecAll", "-c", "ten-year")
38-
.withWorkingDirectory(new File("./native/LRGV/bin/")));
38+
.withWorkingDirectory(new File("./native/LRGV/bin/"))
39+
.withDebugging());
3940
}
4041

4142
@Override

src/main/java/org/moeaframework/benchmarks/WDS.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ public double[] getEpsilon() {
9494
public Builder getBuilder() {
9595
return new Builder()
9696
.withCommand(SystemUtils.IS_OS_WINDOWS ? getName() + ".exe" : getName())
97-
.withWorkingDirectory(new File("./native/WDS/bin/"));
97+
.withWorkingDirectory(new File("./native/WDS/bin/"))
98+
.withDebugging();
9899
}
99100

100101
}

src/test/java/org/moeaframework/benchmarks/AbstractProblemTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected void testSolution(String problemName, double[] variables, double[] exp
7272
}
7373

7474
try {
75-
Assert.assertArrayEquals("Constraints do not match", expectedConstraints, solution.getConstraintValues(), EPS);
75+
Assert.assertArrayEquals("Constraints do not match", expectedConstraints, solution.getConstraintValues(), EPS);
7676
} catch (AssertionError e) {
7777
System.out.println("Actual Constraints: " + Arrays.toString(solution.getConstraintValues()));
7878
throw e;

src/test/java/org/moeaframework/benchmarks/CarSideImpactTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package org.moeaframework.benchmarks;
1919

20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122

23+
@Ignore
2224
public class CarSideImpactTest extends AbstractProblemTest {
2325

2426
@Test

src/test/java/org/moeaframework/benchmarks/ElectricMotorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package org.moeaframework.benchmarks;
1919

20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122

23+
@Ignore
2224
public class ElectricMotorTest extends AbstractProblemTest {
2325

2426
@Test

src/test/java/org/moeaframework/benchmarks/GAATest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package org.moeaframework.benchmarks;
1919

20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122

23+
@Ignore
2224
public class GAATest extends AbstractProblemTest {
2325

2426
@Test

src/test/java/org/moeaframework/benchmarks/HBVTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package org.moeaframework.benchmarks;
1919

20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122

23+
@Ignore
2224
public class HBVTest extends AbstractProblemTest {
2325

2426
@Test

src/test/java/org/moeaframework/benchmarks/LRGVTest.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
*/
1818
package org.moeaframework.benchmarks;
1919

20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122

2223
public class LRGVTest extends AbstractProblemTest {
2324

2425
@Test
26+
@Ignore
2527
public void testSolve() {
2628
testSolve("LRGV");
2729
}
@@ -44,4 +46,26 @@ public void testUpperBound() {
4446
false);
4547
}
4648

49+
// Windows:
50+
// Starting process '.\native\LRGV\bin\lrgv.exe -m std-io -b AllDecAll -c ten-year'
51+
// << 0.0 0.0 0.1 0.1 0.0 0.0 0.0 0.0
52+
// >> 0.067799999999999999 0.54275000000000007 0.052332950946083 0 0 0 -0.6038095238095238 -0.45176767676767671 0 1372.9499999999534
53+
// Actual Constraints: [-0.6038095238095238, -0.4517676767676767, 0.0, 1372.9499999999534]
54+
// Waiting for process to exit...
55+
// Process exited with code 0
56+
// Starting process '.\native\LRGV\bin\lrgv.exe -m std-io -b AllDecAll -c ten-year'
57+
// << 1.0 1.0 1.0 0.4 3.0 0.0 3.0 0.0
58+
// >> 0.14688755308684337 1 0.73901009177481636 0.0013347587141167424 0.00081400000000000005 1.11011894436792e-311 0 0 -0.0080529641534905494 15
59+
// Actual Constraints: [0.0, 0.0, -0.00805296415349055, 15.0]
60+
61+
// Linux:
62+
// Starting process './lrgv -m std-io -b AllDecAll -c ten-year'
63+
// << 0.0 0.0 0.1 0.1 0.0 0.0 0.0 0.0
64+
// >> 0.067799999999999999 0.54275000000000007 0.052332950946083 0 0 8.2373232240163736e-67 -0.6038095238095238 -0.45176767676767671 0 0
65+
// Waiting for process to exit...
66+
// Process exited with code 0
67+
// Starting process './lrgv -m std-io -b AllDecAll -c ten-year'
68+
// << 1.0 1.0 1.0 0.4 3.0 0.0 3.0 0.0
69+
// >> 0.14688755308684337 1 0.73901009177481636 0.0013347587141167424 0.00081400000000000005 8.2373232240163736e-67 0 0 -0.0080529641534905494 0
70+
4771
}

src/test/java/org/moeaframework/benchmarks/LakeProblemTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package org.moeaframework.benchmarks;
1919

20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122

23+
@Ignore
2224
public class LakeProblemTest extends AbstractProblemTest {
2325

2426
@Test

0 commit comments

Comments
 (0)