diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-03-26 21:34:37 +0000 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-03-26 21:34:37 +0000 |
commit | 2bf2d3ac2c578de481ecfd545d58be73c5628996 (patch) | |
tree | ec47cfeedaed5bf677cab1bc9e910782369fe127 /src/jcgp/modules | |
parent | bc4fafb9d3c60993253f7e78c10338c901de653a (diff) |
Node grid has been refactored a few times, settings pane is almost complete, console is all done.
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"; + } + } |