private void lethalMutate() { double mutationRate = ModelParameters.getDouble("BASE_LETHAL_MUTATION_RATE") * getMutatorStrength(); if (Rand.getDouble() < mutationRate) { die(); } }
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(); } }
private void beneficialMutate(int currentGeneration, ArrayList mutationProperties) { double mutationRate = ModelParameters.getDouble("BASE_BENEFICIAL_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++) { double u = Rand.getFloat(); double fitnessEffect = 1 + ((-ModelParameters.getFloat("DEFAULT_BENEFICIAL_EFFECT")) * Math.log(1 - u)); updateMutationInformation(currentGeneration, mutationProperties, fitnessEffect); } }