aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/tests/NodeTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/tests/NodeTests.java')
-rw-r--r--src/jcgp/tests/NodeTests.java37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/jcgp/tests/NodeTests.java b/src/jcgp/tests/NodeTests.java
index 9ea6769..ee26d38 100644
--- a/src/jcgp/tests/NodeTests.java
+++ b/src/jcgp/tests/NodeTests.java
@@ -6,9 +6,8 @@ import java.util.Random;
import jcgp.Parameters;
import jcgp.Utilities;
-import jcgp.function.Addition;
+import jcgp.function.Arithmetic;
import jcgp.function.Function;
-import jcgp.function.Subtraction;
import jcgp.population.Chromosome;
import jcgp.population.Connection;
import jcgp.population.Node;
@@ -63,7 +62,7 @@ public class NodeTests {
public void setUp() throws Exception {
node = new Node(chromosome, 0, 0);
// make node with anonymous addition function and hard-coded value connections
- node.initialise(new Addition(),
+ node.initialise(new Arithmetic.Addition(),
new Connection[]{new Connection() {
@Override
@@ -72,6 +71,12 @@ public class NodeTests {
return arg1;
}
+ @Override
+ public String getDescription() {
+ // blank
+ return null;
+ }
+
},
new Connection() {
@@ -81,6 +86,12 @@ public class NodeTests {
return arg2;
}
+ @Override
+ public String getDescription() {
+ // blank
+ return null;
+ }
+
}});
}
@@ -123,7 +134,7 @@ public class NodeTests {
((int) node.getValue()) == arg1 + arg2);
// put in a different function, check the output has changed appropriately
- node.setFunction(new Subtraction());
+ node.setFunction(new Arithmetic.Subtraction());
assertTrue("Node did not return expected value (difference of arguments).", ((Integer) node.getValue()) == arg1 - arg2);
@@ -141,6 +152,12 @@ public class NodeTests {
return 0;
}
+ @Override
+ public String getDescription() {
+ // blank
+ return null;
+ }
+
};
conn1 = new Connection() {
@@ -150,6 +167,12 @@ public class NodeTests {
return 0;
}
+ @Override
+ public String getDescription() {
+ // blank
+ return null;
+ }
+
};
node.initialise(null, conn0, conn1);
@@ -164,6 +187,12 @@ public class NodeTests {
// blank
return 0;
}
+
+ @Override
+ public String getDescription() {
+ // blank
+ return null;
+ }
};
node.setConnection(conn2);