From be6c587cac8bf5a568f037113291acd7aaf56460 Mon Sep 17 00:00:00 2001 From: Marcel Kronfeld Date: Wed, 4 May 2011 12:04:09 +0000 Subject: [PATCH] Cosmetics --- .../mutation/MutateGAInvertBits.java | 2 +- .../go/operators/mutation/MutateOBGAFlip.java | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/eva2/server/go/operators/mutation/MutateGAInvertBits.java b/src/eva2/server/go/operators/mutation/MutateGAInvertBits.java index 2536e118..8ae31302 100644 --- a/src/eva2/server/go/operators/mutation/MutateGAInvertBits.java +++ b/src/eva2/server/go/operators/mutation/MutateGAInvertBits.java @@ -113,7 +113,7 @@ public class MutateGAInvertBits implements InterfaceMutation, java.io.Serializab * @return description */ public static String globalInfo() { - return "This mutation operator inverts n succesive bits."; + return "This mutation operator inverts n successive bits."; } /** This method allows you to set the number of mutations that occur in the diff --git a/src/eva2/server/go/operators/mutation/MutateOBGAFlip.java b/src/eva2/server/go/operators/mutation/MutateOBGAFlip.java index 53d9867f..82007b3c 100644 --- a/src/eva2/server/go/operators/mutation/MutateOBGAFlip.java +++ b/src/eva2/server/go/operators/mutation/MutateOBGAFlip.java @@ -48,21 +48,21 @@ public class MutateOBGAFlip implements InterfaceMutation, java.io.Serializable { //nothing to init } - public void mutate(AbstractEAIndividual individual) { + public void mutate(AbstractEAIndividual individual) { - int[][] perm = ( (InterfaceOBGAIndividual) individual). - getOBGenotype(); - for (int p = 0; p < perm.length; p++) { - for (int i = 0; i < times; i++) { - int p1 = RNG.randomInt(0, perm[p].length - 1); - int p2 = RNG.randomInt(0, perm[p].length - 1); - int temp = perm[p][p1]; - perm[p][p1] = perm[p][p2]; - perm[p][p2] = temp; - } - } - ( (InterfaceOBGAIndividual) individual).SetOBGenotype(perm); - } + int[][] perm = ( (InterfaceOBGAIndividual) individual). + getOBGenotype(); + for (int p = 0; p < perm.length; p++) { + for (int i = 0; i < times; i++) { + int p1 = RNG.randomInt(0, perm[p].length - 1); + int p2 = RNG.randomInt(0, perm[p].length - 1); + int temp = perm[p][p1]; + perm[p][p1] = perm[p][p2]; + perm[p][p2] = temp; + } + } + ( (InterfaceOBGAIndividual) individual).SetOBGenotype(perm); + } /** This method allows you to perform either crossover on the strategy parameters * or to deal in some other way with the crossover event.