aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/tests/ChromosomeTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/backend/tests/ChromosomeTests.java')
-rw-r--r--src/jcgp/backend/tests/ChromosomeTests.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jcgp/backend/tests/ChromosomeTests.java b/src/jcgp/backend/tests/ChromosomeTests.java
index bc0c57d..c326805 100644
--- a/src/jcgp/backend/tests/ChromosomeTests.java
+++ b/src/jcgp/backend/tests/ChromosomeTests.java
@@ -2,7 +2,6 @@ package jcgp.backend.tests;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import jcgp.backend.function.SymbolicRegressionFunctions;
import jcgp.backend.population.Chromosome;
import jcgp.backend.population.Connection;
import jcgp.backend.population.Input;
@@ -46,7 +45,7 @@ public class ChromosomeTests {
@BeforeClass
public static void setUpBeforeClass() {
resources = new ModifiableResources();
- resources.setFunctionSet(new SymbolicRegressionFunctions());
+ resources.setFunctionSet(new TestFunctionSet());
}
@Before
@@ -225,9 +224,12 @@ public class ChromosomeTests {
chromosome.setInputs(5, 8, 4);
+ Integer output0 = (Integer) chromosome.getOutput(0).calculate();
+ Integer output1 = (Integer) chromosome.getOutput(1).calculate();
+
// with this configuration, the outputs should be 13 and 25.
- assertTrue("Incorrect output returned.", (Integer) chromosome.getOutput(0).calculate() == 13);
- assertTrue("Incorrect output returned.", (Integer) chromosome.getOutput(1).calculate() == 25);
+ assertTrue("Incorrect output returned: " + output0, output0 == 13.0);
+ assertTrue("Incorrect output returned: " + output1, output1 == 25.0);
}
/**