diff options
Diffstat (limited to 'src/jcgp/backend/modules/fitness')
-rw-r--r-- | src/jcgp/backend/modules/fitness/TestCaseProblem.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jcgp/backend/modules/fitness/TestCaseProblem.java b/src/jcgp/backend/modules/fitness/TestCaseProblem.java index 4259285..7dd24af 100644 --- a/src/jcgp/backend/modules/fitness/TestCaseProblem.java +++ b/src/jcgp/backend/modules/fitness/TestCaseProblem.java @@ -56,7 +56,7 @@ public abstract class TestCaseProblem<U> extends Problem { maxFitness = new IntegerParameter(0, "Max fitness", true, false) { @Override - public void validate(int newValue) { + public void validate(Number newValue) { // blank } }; @@ -67,14 +67,14 @@ public abstract class TestCaseProblem<U> extends Problem { @Override public void evaluate(Population population, Resources resources) { // for every chromosome in the population - for (int i = 0; i < resources.getInt("popSize"); i++) { + for (int i = 0; i < resources.populationSize(); i++) { // assume an initial fitness of 0 int fitness = 0; // for each test case for (int t = 0; t < testCases.size(); t++) { population.getChromosome(i).setInputs(testCases.get(t).getInputs()); // check each output - for (int o = 0; o < resources.getInt("outputs"); o++) { + for (int o = 0; o < resources.outputs(); o++) { if (population.getChromosome(i).getOutput(o).calculate() == testCases.get(t).getOutput(o)) { fitness++; } @@ -86,7 +86,7 @@ public abstract class TestCaseProblem<U> extends Problem { } @Override - public Parameter[] getLocalParameters() { + public Parameter<?>[] getLocalParameters() { return new Parameter[]{maxFitness}; } |