aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/mutator
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-05-07 18:38:27 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-05-07 18:38:27 +0100
commit7f89d81e6f8a5ce82d42c3b852b5219edaa4b86c (patch)
treecc069b43e1cdf7cb69456fe7e86e1f51d6ea8642 /src/jcgp/backend/modules/mutator
parent8189116ea4b5db4675e31dfd04a5687d55e29262 (diff)
Removed reflection for now, added fitness orientation support
Diffstat (limited to 'src/jcgp/backend/modules/mutator')
-rw-r--r--src/jcgp/backend/modules/mutator/PointMutator.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jcgp/backend/modules/mutator/PointMutator.java b/src/jcgp/backend/modules/mutator/PointMutator.java
index 9e421c2..5aba0d1 100644
--- a/src/jcgp/backend/modules/mutator/PointMutator.java
+++ b/src/jcgp/backend/modules/mutator/PointMutator.java
@@ -3,7 +3,7 @@ package jcgp.backend.modules.mutator;
import jcgp.backend.parameters.BooleanParameter;
import jcgp.backend.parameters.IntegerParameter;
import jcgp.backend.population.Chromosome;
-import jcgp.backend.population.MutableElement;
+import jcgp.backend.population.Mutable;
import jcgp.backend.population.Node;
import jcgp.backend.population.Output;
import jcgp.backend.resources.Resources;
@@ -41,7 +41,7 @@ public abstract class PointMutator extends Mutator {
// for however many genes must be mutated
for (int i = 0; i < genesMutated.get(); i++) {
- MutableElement m = chromosome.getRandomMutableElement();
+ Mutable m = chromosome.getRandomMutable();
if (report.get()) getResources().report("[Mutator] Mutation " + i + " selected " + m + ", ");
@@ -69,7 +69,7 @@ public abstract class PointMutator extends Mutator {
if (report.get()) getResources().reportln("to " + ((Node) m).getFunction());
} else {
// if we decided to mutate connection, subtract 1 from geneType so it fits into the arity range
- geneType -= 1;
+ geneType--;
if (report.get()) getResources().report("changed connection " + geneType + " from " + ((Node) m).getConnection(geneType) + " ");
m.setConnection(geneType, chromosome.getRandomConnection(((Node) m).getColumn()));