From 88314e71f908efcfc38da3b800319c171a6ccceb Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Fri, 18 Apr 2014 09:08:41 +0100 Subject: Added parsers, did a bit of testing, switched to java8 --- src/jcgp/backend/tests/ChromosomeTests.java | 4 ++-- src/jcgp/backend/tests/NodeTests.java | 8 ++++---- src/jcgp/backend/tests/OutputTests.java | 4 ++-- src/jcgp/backend/tests/PopulationTests.java | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/jcgp/backend/tests') diff --git a/src/jcgp/backend/tests/ChromosomeTests.java b/src/jcgp/backend/tests/ChromosomeTests.java index 07326a7..36278ba 100644 --- a/src/jcgp/backend/tests/ChromosomeTests.java +++ b/src/jcgp/backend/tests/ChromosomeTests.java @@ -2,7 +2,7 @@ package jcgp.backend.tests; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import jcgp.backend.function.IntegerArithmetic; +import jcgp.backend.function.DoubleArithmetic; import jcgp.backend.population.Chromosome; import jcgp.backend.population.Connection; import jcgp.backend.population.Input; @@ -46,7 +46,7 @@ public class ChromosomeTests { @BeforeClass public static void setUpBeforeClass() { resources = new ModifiableResources(); - resources.setFunctionSet(new IntegerArithmetic()); + resources.setFunctionSet(new DoubleArithmetic()); } @Before diff --git a/src/jcgp/backend/tests/NodeTests.java b/src/jcgp/backend/tests/NodeTests.java index 0e08d92..c9f247a 100644 --- a/src/jcgp/backend/tests/NodeTests.java +++ b/src/jcgp/backend/tests/NodeTests.java @@ -3,7 +3,7 @@ package jcgp.backend.tests; import static org.junit.Assert.assertTrue; import jcgp.backend.exceptions.InvalidArgumentsException; import jcgp.backend.function.Function; -import jcgp.backend.function.IntegerArithmetic; +import jcgp.backend.function.DoubleArithmetic; import jcgp.backend.population.Chromosome; import jcgp.backend.population.Connection; import jcgp.backend.population.Node; @@ -41,7 +41,7 @@ public class NodeTests { public static void setUpBeforeClass() { resources = new ModifiableResources(); - resources.setFunctionSet(new IntegerArithmetic()); + resources.setFunctionSet(new DoubleArithmetic()); 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 IntegerArithmetic.Addition(), + node.initialise(new DoubleArithmetic.Addition(), new Connection[]{new Connection() { @Override @@ -113,7 +113,7 @@ public class NodeTests { ((int) node.getValue()) == arg1 + arg2); // put in a different function, check the output has changed appropriately - node.setFunction(new IntegerArithmetic.Subtraction()); + node.setFunction(new DoubleArithmetic.Subtraction()); assertTrue("Node did not return expected value (difference of arguments).", ((Integer) node.getValue()) == arg1 - arg2); diff --git a/src/jcgp/backend/tests/OutputTests.java b/src/jcgp/backend/tests/OutputTests.java index a331f2d..95b7fc7 100644 --- a/src/jcgp/backend/tests/OutputTests.java +++ b/src/jcgp/backend/tests/OutputTests.java @@ -1,7 +1,7 @@ package jcgp.backend.tests; import static org.junit.Assert.assertTrue; -import jcgp.backend.function.IntegerArithmetic; +import jcgp.backend.function.DoubleArithmetic; import jcgp.backend.population.Chromosome; import jcgp.backend.population.Connection; import jcgp.backend.population.Output; @@ -35,7 +35,7 @@ public class OutputTests { @BeforeClass public static void setUpBeforeClass() { resources = new ModifiableResources(); - resources.setFunctionSet(new IntegerArithmetic()); + resources.setFunctionSet(new DoubleArithmetic()); chromosome = new Chromosome(resources); } diff --git a/src/jcgp/backend/tests/PopulationTests.java b/src/jcgp/backend/tests/PopulationTests.java index fb8ced4..fca9c4f 100644 --- a/src/jcgp/backend/tests/PopulationTests.java +++ b/src/jcgp/backend/tests/PopulationTests.java @@ -1,7 +1,7 @@ package jcgp.backend.tests; import static org.junit.Assert.assertTrue; -import jcgp.backend.function.IntegerArithmetic; +import jcgp.backend.function.DoubleArithmetic; import jcgp.backend.population.Chromosome; import jcgp.backend.population.Population; import jcgp.backend.resources.ModifiableResources; @@ -32,7 +32,7 @@ public class PopulationTests { @BeforeClass public static void setUpBeforeClass() throws Exception { resources = new ModifiableResources(); - resources.setFunctionSet(new IntegerArithmetic()); + resources.setFunctionSet(new DoubleArithmetic()); } @Before -- cgit v1.2.3