aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/mutator
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-04-03 15:29:24 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-04-03 15:29:24 +0100
commit0dbf126fc524bc029d9f5803d849b7c8f43fe389 (patch)
tree35d7c23b371614388cbb7a4bc247374759b95a33 /src/jcgp/backend/modules/mutator
parent02fd2bc7059da416937beb1abe67e5ca60379030 (diff)
Visual feedback for parameters implemented.
Diffstat (limited to 'src/jcgp/backend/modules/mutator')
-rw-r--r--src/jcgp/backend/modules/mutator/PointMutator.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/jcgp/backend/modules/mutator/PointMutator.java b/src/jcgp/backend/modules/mutator/PointMutator.java
index 62d827d..cdac8bb 100644
--- a/src/jcgp/backend/modules/mutator/PointMutator.java
+++ b/src/jcgp/backend/modules/mutator/PointMutator.java
@@ -1,7 +1,5 @@
package jcgp.backend.modules.mutator;
-import java.util.HashMap;
-
import jcgp.backend.function.Function;
import jcgp.backend.modules.ModuleStatus;
import jcgp.backend.parameters.DoubleParameter;
@@ -15,15 +13,16 @@ import jcgp.JCGP.Resources;
public class PointMutator implements Mutator {
private DoubleParameter mutationRate;
- private HashMap<String, Parameter> localParameters;
-
+
private ModuleStatus status = ModuleStatus.READY;
public PointMutator() {
- mutationRate = new DoubleParameter(0.5, "Percent mutation", false, false, false);
-
- localParameters = new HashMap<String, Parameter>();
- localParameters.put("mutRate", mutationRate);
+ mutationRate = new DoubleParameter(0.5, "Percent mutation", false, false) {
+ @Override
+ public void validate(double newValue) {
+ // TODO this
+ }
+ };
}
@Override
@@ -47,8 +46,8 @@ public class PointMutator implements Mutator {
}
@Override
- public HashMap<String, Parameter> getLocalParameters() {
- return localParameters;
+ public Parameter[] getLocalParameters() {
+ return new Parameter[] {mutationRate};
}
@Override