aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/tests
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-05-14 01:32:51 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-05-14 01:32:51 +0100
commitc35a6806df01481c1b169cd0fc47660ea1cc10fb (patch)
tree7a9a90d88a9b962bcc091533997df798ac454423 /src/jcgp/backend/tests
parent95b4a9421923cec63b6e0e8f58972d146100bd0f (diff)
Refactored Mutable, commented a little bit of the GUI package
Diffstat (limited to 'src/jcgp/backend/tests')
-rw-r--r--src/jcgp/backend/tests/ChromosomeTests.java6
-rw-r--r--src/jcgp/backend/tests/OutputTests.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/jcgp/backend/tests/ChromosomeTests.java b/src/jcgp/backend/tests/ChromosomeTests.java
index b5c1da7..7cbf2e2 100644
--- a/src/jcgp/backend/tests/ChromosomeTests.java
+++ b/src/jcgp/backend/tests/ChromosomeTests.java
@@ -136,7 +136,7 @@ public class ChromosomeTests {
}
// mutate an output in clone, check that the same node in chromosome produces a different output
- clone.getOutput(1).setConnection(resources.getRandomInt(resources.arity()), clone.getInput(2));
+ clone.getOutput(1).setSource(clone.getInput(2));
assertTrue("Mutation affected nodes in both chromosomes.",
clone.getOutput(1).calculate() != chromosome.getOutput(1).calculate());
@@ -332,8 +332,8 @@ public class ChromosomeTests {
c.getNode(1, 1).initialise(resources.getFunction(0), c.getNode(0, 0), c.getInput(1));
c.getNode(1, 2).initialise(resources.getFunction(0), c.getNode(1, 1), c.getInput(2));
- c.getOutput(0).setConnection(0, c.getNode(0, 0));
- c.getOutput(1).setConnection(0, c.getNode(1, 2));
+ c.getOutput(0).setSource(c.getNode(0, 0));
+ c.getOutput(1).setSource(c.getNode(1, 2));
return c;
}
diff --git a/src/jcgp/backend/tests/OutputTests.java b/src/jcgp/backend/tests/OutputTests.java
index 8cc10a8..c5aa6b4 100644
--- a/src/jcgp/backend/tests/OutputTests.java
+++ b/src/jcgp/backend/tests/OutputTests.java
@@ -47,7 +47,7 @@ public class OutputTests {
@Test
public void evaluationsTest() {
// set source connection, check that the appropriate value is returned
- output.setConnection(0, new Connection() {
+ output.setSource(new Connection() {
@Override
public Object getValue() {
@@ -70,7 +70,7 @@ public class OutputTests {
return 0;
}
};
- output.setConnection(0, newConn);
+ output.setSource(newConn);
assertTrue("Incorrect connection returned.", output.getSource() == newConn);
}