diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-07 15:58:30 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-07 15:58:30 +0100 |
commit | 226365bd6a0f56143ffbce7379857ff3e126fbaf (patch) | |
tree | 4582b16a5519c94b121a369104157859dc97cba1 /src/jcgp/backend/modules/fitness | |
parent | 67ace66f66ffaa00e1bd1495c0d406c801e59c5c (diff) |
Refactoring resources for (hopefully) the last time
Diffstat (limited to 'src/jcgp/backend/modules/fitness')
-rw-r--r-- | src/jcgp/backend/modules/fitness/DigitalCircuit.java | 5 | ||||
-rw-r--r-- | src/jcgp/backend/modules/fitness/SymbolicRegression.java | 5 | ||||
-rw-r--r-- | src/jcgp/backend/modules/fitness/TestCaseProblem.java | 4 |
3 files changed, 9 insertions, 5 deletions
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<Integer> { - 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<Integer> { - 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<U> extends Problem { private ArrayList<TestCase<U>> 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) { |