From 260f1baaab10ab9b1db67ab587bc36adcb34494e Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 8 Apr 2014 20:04:12 +0100 Subject: GUIParameters all refactored and commented. --- src/jcgp/backend/modules/fitness/TestCaseProblem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jcgp/backend/modules/fitness') 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 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 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 extends Problem { } @Override - public Parameter[] getLocalParameters() { + public Parameter[] getLocalParameters() { return new Parameter[]{maxFitness}; } -- cgit v1.2.3