diff options
Diffstat (limited to 'src/jcgp/modules')
-rw-r--r-- | src/jcgp/modules/Module.java | 5 | ||||
-rw-r--r-- | src/jcgp/modules/ea/StandardEA.java | 16 | ||||
-rw-r--r-- | src/jcgp/modules/fitness/TestCaseEvaluator.java | 12 | ||||
-rw-r--r-- | src/jcgp/modules/mutator/PointMutator.java | 12 |
4 files changed, 39 insertions, 6 deletions
diff --git a/src/jcgp/modules/Module.java b/src/jcgp/modules/Module.java index 4997ce7..7cf0b8d 100644 --- a/src/jcgp/modules/Module.java +++ b/src/jcgp/modules/Module.java @@ -7,5 +7,8 @@ import jcgp.parameters.Parameter; public interface Module { - public HashMap<String, Parameter> activate(Resources parameters); + public void activate(Resources parameters); + + public HashMap<String, Parameter> getLocalParameters(); + } diff --git a/src/jcgp/modules/ea/StandardEA.java b/src/jcgp/modules/ea/StandardEA.java index 7e77977..1d27004 100644 --- a/src/jcgp/modules/ea/StandardEA.java +++ b/src/jcgp/modules/ea/StandardEA.java @@ -61,9 +61,19 @@ public class StandardEA implements EvolutionaryAlgorithm { } @Override - public HashMap<String, Parameter> activate(Resources parameters) { - parameters.setManagedParameter("popSize", true); - + public void activate(Resources parameters) { + parameters.getParameter("popSize").setManaged(true); + } + + @Override + public HashMap<String, Parameter> getLocalParameters() { return localParameters; } + + @Override + public String toString() { + return "(μ + λ)"; + } + + } diff --git a/src/jcgp/modules/fitness/TestCaseEvaluator.java b/src/jcgp/modules/fitness/TestCaseEvaluator.java index cd131b5..77b282c 100644 --- a/src/jcgp/modules/fitness/TestCaseEvaluator.java +++ b/src/jcgp/modules/fitness/TestCaseEvaluator.java @@ -28,7 +28,17 @@ public class TestCaseEvaluator implements FitnessFunction { } @Override - public HashMap<String, Parameter> activate(Resources parameters) { + public void activate(Resources parameters) { + // nothing + } + + @Override + public HashMap<String, Parameter> getLocalParameters() { return new HashMap<String, Parameter>(); } + + @Override + public String toString() { + return "Test case"; + } } diff --git a/src/jcgp/modules/mutator/PointMutator.java b/src/jcgp/modules/mutator/PointMutator.java index 51a4390..e9be153 100644 --- a/src/jcgp/modules/mutator/PointMutator.java +++ b/src/jcgp/modules/mutator/PointMutator.java @@ -42,8 +42,18 @@ public class PointMutator implements Mutator { } @Override - public HashMap<String, Parameter> activate(Resources parameters) { + public void activate(Resources parameters) { + // nothing + } + + @Override + public HashMap<String, Parameter> getLocalParameters() { return localParameters; } + @Override + public String toString() { + return "Point mutation"; + } + } |