Skip to content
Snippets Groups Projects
Commit c7310342 authored by Lennart Eichhorn's avatar Lennart Eichhorn
Browse files

Fixed bug, where program would crash if mutationChance got <= minimalMutationChance

parent 18db4fe9
Branches
Tags
No related merge requests found
......@@ -60,6 +60,8 @@ public class Crossover<T extends Enum<?>> implements Mutator {
System.out.printf("CrossoverChance: %.4f\n", this.crossoverChance);
this.crossoverChance *= (1 - this.crossoverMultiplier); // Lower mutation rate with generation
}else{
return population;
}
return mutatedPopulation;
}
......
......@@ -59,6 +59,8 @@ public class SinglePoint<T extends Enum<?>> implements Mutator {
System.out.printf("MutationChance: %.4f\n", this.mutationChance);
this.mutationChance *= (1 - this.mutationMultiplier); // Lower mutation rate with generation
}else{
return population;
}
return mutatedPopulation;
}
......
......@@ -64,6 +64,8 @@ public class SinglePointGlobalBend<T extends Enum<?>> implements Mutator { // TO
System.out.printf("MutationChance: %.4f\n", this.mutationChance);
this.mutationChance *= (1 - this.mutationMultiplier); // Lower mutation rate with generation
}else{
return population;
}
return mutatedPopulation;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment