From 0dbf126fc524bc029d9f5803d849b7c8f43fe389 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Thu, 3 Apr 2014 15:29:24 +0100 Subject: Visual feedback for parameters implemented. --- src/jcgp/backend/modules/mutator/PointMutator.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/jcgp/backend/modules/mutator') 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 localParameters; - + private ModuleStatus status = ModuleStatus.READY; public PointMutator() { - mutationRate = new DoubleParameter(0.5, "Percent mutation", false, false, false); - - localParameters = new HashMap(); - 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 getLocalParameters() { - return localParameters; + public Parameter[] getLocalParameters() { + return new Parameter[] {mutationRate}; } @Override -- cgit v1.2.3