From 226365bd6a0f56143ffbce7379857ff3e126fbaf Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Mon, 7 Apr 2014 15:58:30 +0100 Subject: Refactoring resources for (hopefully) the last time --- src/jcgp/backend/modules/fitness/DigitalCircuit.java | 5 +++-- src/jcgp/backend/modules/fitness/SymbolicRegression.java | 5 +++-- src/jcgp/backend/modules/fitness/TestCaseProblem.java | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/jcgp/backend/modules/fitness') diff --git a/src/jcgp/backend/modules/fitness/DigitalCircuit.java b/src/jcgp/backend/modules/fitness/DigitalCircuit.java index b01bdc5..8677d5f 100644 --- a/src/jcgp/backend/modules/fitness/DigitalCircuit.java +++ b/src/jcgp/backend/modules/fitness/DigitalCircuit.java @@ -1,11 +1,12 @@ package jcgp.backend.modules.fitness; import jcgp.backend.function.BitwiseLogic; +import jcgp.backend.resources.Resources; public class DigitalCircuit extends TestCaseProblem { - public DigitalCircuit() { - super(); + public DigitalCircuit(Resources resources) { + super(resources); functionSet = new BitwiseLogic(); } diff --git a/src/jcgp/backend/modules/fitness/SymbolicRegression.java b/src/jcgp/backend/modules/fitness/SymbolicRegression.java index da2e69e..cb9d1a7 100644 --- a/src/jcgp/backend/modules/fitness/SymbolicRegression.java +++ b/src/jcgp/backend/modules/fitness/SymbolicRegression.java @@ -1,11 +1,12 @@ package jcgp.backend.modules.fitness; import jcgp.backend.function.IntegerArithmetic; +import jcgp.backend.resources.Resources; public class SymbolicRegression extends TestCaseProblem { - public SymbolicRegression() { - super(); + public SymbolicRegression(Resources resources) { + super(resources); functionSet = new IntegerArithmetic(); } diff --git a/src/jcgp/backend/modules/fitness/TestCaseProblem.java b/src/jcgp/backend/modules/fitness/TestCaseProblem.java index 7753e26..4259285 100644 --- a/src/jcgp/backend/modules/fitness/TestCaseProblem.java +++ b/src/jcgp/backend/modules/fitness/TestCaseProblem.java @@ -51,7 +51,9 @@ public abstract class TestCaseProblem extends Problem { private ArrayList> testCases; private IntegerParameter maxFitness; - public TestCaseProblem() { + public TestCaseProblem(Resources resources) { + super(); + maxFitness = new IntegerParameter(0, "Max fitness", true, false) { @Override public void validate(int newValue) { -- cgit v1.2.3