diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-02-11 08:30:36 +0000 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-02-11 08:30:36 +0000 |
commit | 3fc4bf4a2ea7c6cff9810b76964dd3c1388c0b3f (patch) | |
tree | f9f939b61474b5d201dede252881c2d4f526dc72 /src/jcgp/tests | |
parent | d8ab8a2424a689cff4c787b0448c893facaadf6f (diff) |
Updated README, made a few changes to Chromosome's mutation methods, will be working on that throughout the day
Diffstat (limited to 'src/jcgp/tests')
-rw-r--r-- | src/jcgp/tests/ChromosomeTests.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jcgp/tests/ChromosomeTests.java b/src/jcgp/tests/ChromosomeTests.java index 75e3596..50d17b9 100644 --- a/src/jcgp/tests/ChromosomeTests.java +++ b/src/jcgp/tests/ChromosomeTests.java @@ -11,6 +11,7 @@ import jcgp.function.FunctionSet; import jcgp.function.Subtraction; import jcgp.population.Chromosome; import jcgp.population.Input; +import jcgp.population.MutableElement; import jcgp.population.Node; import jcgp.population.Output; @@ -90,7 +91,10 @@ public class ChromosomeTests { assertTrue("Incorrect output returned.", outputReturn); // get a mutable element, check that it is a Mutable - boolean mutableReturn = chromosome.getRandomMutableElement() instanceof Output; + boolean mutableReturn = chromosome.getRandomMutableElement() != chromosome.getRandomMutableElement() && chromosome.getRandomMutableElement() instanceof MutableElement; + assertTrue("Returned the same element.", mutableReturn); + + // set a fitness value, check if returned value is the same chromosome.setFitness(10); |