aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/mutator
diff options
context:
space:
mode:
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