From 2bf2d3ac2c578de481ecfd545d58be73c5628996 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Wed, 26 Mar 2014 21:34:37 +0000 Subject: Node grid has been refactored a few times, settings pane is almost complete, console is all done. --- src/jcgp/modules/Module.java | 5 ++++- src/jcgp/modules/ea/StandardEA.java | 16 +++++++++++++--- src/jcgp/modules/fitness/TestCaseEvaluator.java | 12 +++++++++++- src/jcgp/modules/mutator/PointMutator.java | 12 +++++++++++- 4 files changed, 39 insertions(+), 6 deletions(-) (limited to 'src/jcgp/modules') 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 activate(Resources parameters); + public void activate(Resources parameters); + + public HashMap 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 activate(Resources parameters) { - parameters.setManagedParameter("popSize", true); - + public void activate(Resources parameters) { + parameters.getParameter("popSize").setManaged(true); + } + + @Override + public HashMap 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 activate(Resources parameters) { + public void activate(Resources parameters) { + // nothing + } + + @Override + public HashMap getLocalParameters() { return new HashMap(); } + + @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 activate(Resources parameters) { + public void activate(Resources parameters) { + // nothing + } + + @Override + public HashMap getLocalParameters() { return localParameters; } + @Override + public String toString() { + return "Point mutation"; + } + } -- cgit v1.2.3