Added test for F23 Problem
This commit is contained in:
parent
2e9343bf74
commit
d7b677c6b8
24
test/eva2/problems/F23ProblemTest.java
Normal file
24
test/eva2/problems/F23ProblemTest.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package eva2.problems;
|
||||||
|
|
||||||
|
import eva2.tools.math.Mathematics;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
public class F23ProblemTest extends TestCase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Generalized Schaffer function has its minimum
|
||||||
|
* at x_{i} = 0
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void testEvaluate() throws Exception {
|
||||||
|
F23Problem problem = new F23Problem();
|
||||||
|
|
||||||
|
for (int i = 1; i < 100; i++) {
|
||||||
|
double[] x = Mathematics.zeroes(i);
|
||||||
|
double[] res = problem.evaluate(x);
|
||||||
|
assertEquals(1, res.length);
|
||||||
|
assertEquals(0.0, res[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user