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/ProbabilisticMutator.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jcgp/backend/modules/mutator/ProbabilisticMutator.java b/src/jcgp/backend/modules/mutator/ProbabilisticMutator.java
index e3c1d03..cacb451 100644
--- a/src/jcgp/backend/modules/mutator/ProbabilisticMutator.java
+++ b/src/jcgp/backend/modules/mutator/ProbabilisticMutator.java
@@ -70,7 +70,7 @@ public class ProbabilisticMutator implements Mutator {
for (int c = 0; c < resources.columns(); c++) {
// go through all connections
for (int a = 0; a < resources.arity(); a++) {
- if (mutate()) {
+ if (mutateGene()) {
Node n = chromosome.getNode(r, c);
if (report.get()) resources.report("[Mutator] Mutating " + n +
@@ -83,7 +83,7 @@ public class ProbabilisticMutator implements Mutator {
}
}
// deal with node function next
- if (mutate()) {
+ if (mutateGene()) {
Node n = chromosome.getNode(r, c);
if (report.get()) resources.report("[Mutator] Mutating " + n +
", changed function from " + n.getFunction());
@@ -96,7 +96,7 @@ public class ProbabilisticMutator implements Mutator {
}
// finally, mutate outputs
for (int o = 0; o < resources.outputs(); o++) {
- if (mutate()) {
+ if (mutateGene()) {
Output out = chromosome.getOutput(o);
if (report.get()) resources.report("[Mutator] Mutating " + out +
@@ -120,7 +120,7 @@ public class ProbabilisticMutator implements Mutator {
*
* @return true if a mutation should be performed, false if otherwise.
*/
- private boolean mutate() {
+ private boolean mutateGene() {
return resources.getRandomDouble(100) < mutationProbability.get();
}