aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/mutator
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-04-26 19:56:24 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-04-26 19:56:24 +0100
commit4c8de2402f2878cde7587c7f3bbf4ffaea86efd4 (patch)
tree29156510f648a2d9f8de4df3b2617d4a056e1d90 /src/jcgp/backend/modules/mutator
parentb0c0698e5503c2506217117bf144fde31e6f6601 (diff)
Moved files around to different folders, and commented some more packages. Aiming to have the entire backend fully commented by the end of today
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();
}