From e6dd7711c7dad5e000445208eb5845801f4ccffc Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Sun, 6 Apr 2014 21:58:53 +0100 Subject: About to make big changes to the way fitness works, committing just in case --- .../backend/modules/fitness/TestCaseEvaluator.java | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/jcgp/backend/modules/fitness/TestCaseEvaluator.java (limited to 'src/jcgp/backend/modules/fitness/TestCaseEvaluator.java') diff --git a/src/jcgp/backend/modules/fitness/TestCaseEvaluator.java b/src/jcgp/backend/modules/fitness/TestCaseEvaluator.java deleted file mode 100644 index 5ff6973..0000000 --- a/src/jcgp/backend/modules/fitness/TestCaseEvaluator.java +++ /dev/null @@ -1,43 +0,0 @@ -package jcgp.backend.modules.fitness; - -import jcgp.JCGP.Resources; -import jcgp.backend.modules.ModuleStatus; -import jcgp.backend.parameters.Parameter; -import jcgp.backend.population.Population; - -public class TestCaseEvaluator implements FitnessFunction { - - @Override - public void evaluate(Population population, Resources resources) { - // for every chromosome in the population - 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 < resources.getInt("outputs"); o++) { - if (population.getChromosome(i).getOutput(o).calculate() == resources.getTestCase(t).getOutput(o)) { - fitness++; - } - } - } - population.getChromosome(i).setFitness(fitness); - } - } - - @Override - public Parameter[] getLocalParameters() { - return null; - } - - @Override - public String toString() { - return "Test case"; - } - - @Override - public ModuleStatus getStatus(Resources resources) { - return null; - } -} -- cgit v1.2.3