diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-03-30 21:07:37 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-03-30 21:07:37 +0100 |
commit | 04b35ccdad6e18701ede823e333118b0b22907c2 (patch) | |
tree | 0e993a5ffee4e63c4a2a6eca137da72b2453f868 /src/jcgp/modules/fitness | |
parent | 2bf2d3ac2c578de481ecfd545d58be73c5628996 (diff) |
Running into some issues with running the CGP loop in the background with bindings.
Diffstat (limited to 'src/jcgp/modules/fitness')
-rw-r--r-- | src/jcgp/modules/fitness/TestCaseEvaluator.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/jcgp/modules/fitness/TestCaseEvaluator.java b/src/jcgp/modules/fitness/TestCaseEvaluator.java index 77b282c..d8c1255 100644 --- a/src/jcgp/modules/fitness/TestCaseEvaluator.java +++ b/src/jcgp/modules/fitness/TestCaseEvaluator.java @@ -3,6 +3,7 @@ package jcgp.modules.fitness; import java.util.HashMap; import jcgp.JCGP.Resources; +import jcgp.modules.ModuleStatus; import jcgp.parameters.Parameter; import jcgp.population.Population; @@ -11,13 +12,13 @@ public class TestCaseEvaluator implements FitnessFunction { @Override public void evaluate(Population population, Resources resources) { // for every chromosome in the population - for (int i = 0; i < (int) resources.get("popSize"); i++) { + for (int i = 0; i < resources.getInt("popSize"); i++) { int fitness = 0; // for every test case for (int t = 0; t < resources.getTestCaseCount(); t++) { population.getChromosome(i).setInputs(resources.getTestCase(t).getInputs()); // check every output - for (int o = 0; o < (int) resources.get("outputs"); o++) { + for (int o = 0; o < resources.getInt("outputs"); o++) { if (population.getChromosome(i).getOutput(o).calculate() == resources.getTestCase(t).getOutput(o)) { fitness++; } @@ -28,17 +29,17 @@ public class TestCaseEvaluator implements FitnessFunction { } @Override - public void activate(Resources parameters) { - // nothing - } - - @Override public HashMap<String, Parameter> getLocalParameters() { - return new HashMap<String, Parameter>(); + return null; } @Override public String toString() { return "Test case"; } + + @Override + public ModuleStatus getStatus(Resources resources) { + return null; + } } |