public void mutateMutationRate(int nMutatorMutation, int nAntiMutMutation) { // MutatorLocus locus = getRandomMutatorLocus(); int position = lociPattern.getRandomMutatorPosition(); MutatorLocus locus = (MutatorLocus) loci[position]; for (int i = 0; i < nMutatorMutation; i++) { locus.increaseStrength(); } for (int j = 0; j < nAntiMutMutation; j++) { locus.decreaseStrength(); } }
private void antimutatorMutate(int currentGeneration) { int startingEvolvingGeneration = ModelParameters.getInt("START_EVOLVING_GENERATION"); double mutationRate = ModelParameters.getDouble("INITIAL_ANTIMUTATOR_MUTATION_RATE"); if (currentGeneration >= startingEvolvingGeneration) { mutationRate = ModelParameters.getDouble("EVOLVING_ANTIMUTATOR_MUTATION_RATE") * getMutatorStrength(); } // Poisson poisson = new Poisson(mutationRate, Rand.getEngine()); // int poissonObs = poisson.nextInt(); int poissonObs = Util.getPoisson(mutationRate); for (int nMutation = 0; nMutation < poissonObs; nMutation++) { MutatorLocus locus = getRandomMutatorLocus(); locus.decreaseStrength(); } }