diff options
Diffstat (limited to 'src/jcgp/ea/StandardMutator.java')
-rw-r--r-- | src/jcgp/ea/StandardMutator.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/jcgp/ea/StandardMutator.java b/src/jcgp/ea/StandardMutator.java index 8af3f5c..6a4af1a 100644 --- a/src/jcgp/ea/StandardMutator.java +++ b/src/jcgp/ea/StandardMutator.java @@ -14,18 +14,18 @@ public class StandardMutator implements Mutator { int mutations = (int) (Parameters.getMutationRate() * ((double) Parameters.getNodeCount() / 100)); for (int i = 0; i < mutations; i++) { - MutableElement m = Utilities.getRandomMutable(chromosome); - - if (m instanceof Output) { - m.setConnection(Utilities.getRandomConnection(chromosome, m.getColumn())); - } else if (m instanceof Node) { - int geneType = Utilities.getRandomInt(1 + Parameters.getMaxArity()); - if (geneType < 1) { - ((Node) m).setFunction(Utilities.getRandomFunction()); - } else { - m.setConnection(Utilities.getRandomConnection(chromosome, m.getColumn())); - } - } + MutableElement m = chromosome.getRandomMutableElement(); +// +// if (m instanceof Output) { +// m.setConnection(chromosome.getRandomConnection(m.getColumn())); +// } else if (m instanceof Node) { +// int geneType = Utilities.getRandomInt(1 + Parameters.getMaxArity()); +// if (geneType < 1) { +// ((Node) m).setFunction(Utilities.getRandomFunction()); +// } else { +// m.setConnection(chromosome.getRandomConnection(m.getColumn())); +// } +// } } } } |