diff options
Diffstat (limited to 'src/jcgp/backend/tests/NodeTests.java')
-rw-r--r-- | src/jcgp/backend/tests/NodeTests.java | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/jcgp/backend/tests/NodeTests.java b/src/jcgp/backend/tests/NodeTests.java index 4054661..c63b41e 100644 --- a/src/jcgp/backend/tests/NodeTests.java +++ b/src/jcgp/backend/tests/NodeTests.java @@ -2,7 +2,7 @@ package jcgp.backend.tests; import static org.junit.Assert.assertTrue; import jcgp.backend.exceptions.InvalidArgumentsException; -import jcgp.backend.function.DoubleArithmetic; +import jcgp.backend.function.SymbolicRegressionFunctions; import jcgp.backend.function.Function; import jcgp.backend.population.Chromosome; import jcgp.backend.population.Connection; @@ -41,7 +41,7 @@ public class NodeTests { public static void setUpBeforeClass() { resources = new ModifiableResources(); - resources.setFunctionSet(new DoubleArithmetic()); + resources.setFunctionSet(new SymbolicRegressionFunctions()); chromosome = new Chromosome(resources); } @@ -49,7 +49,7 @@ public class NodeTests { public void setUp() throws Exception { node = new Node(chromosome, 0, 0, resources.arity()); // make node with anonymous addition function and hard-coded value connections - node.initialise(new DoubleArithmetic.Addition(), + node.initialise(new SymbolicRegressionFunctions.Addition(), new Connection[]{new Connection() { @Override @@ -80,7 +80,7 @@ public class NodeTests { Function f = new Function() { @Override - public Object run(Connection... connections) { + public Object run(Object... connections) { // blank return 0; } @@ -90,12 +90,6 @@ public class NodeTests { // blank return 0; } - - @Override - public String getName() { - // blank - return null; - } }; node.setFunction(f); @@ -113,7 +107,7 @@ public class NodeTests { ((int) node.getValue()) == arg1 + arg2); // put in a different function, check the output has changed appropriately - node.setFunction(new DoubleArithmetic.Subtraction()); + node.setFunction(new SymbolicRegressionFunctions.Subtraction()); assertTrue("Node did not return expected value (difference of arguments).", ((Integer) node.getValue()) == arg1 - arg2); @@ -142,7 +136,7 @@ public class NodeTests { Function function = new Function() { @Override - public Object run(Connection... connections) + public Object run(Object... connections) throws InvalidArgumentsException { // blank return null; @@ -152,12 +146,6 @@ public class NodeTests { public int getArity() { return 2; } - - @Override - public String getName() { - // blank - return null; - } }; node.initialise(function, conn0, conn1); |