Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(bestIndividual == null) {
- bestIndividual = pop.getBestIndividual();
- bestFitGeneration = generation;
- }
- else if(pop.getBestFit() < bestIndividual.fitness()){
- bestIndividual = pop.getBestIndividual();
- bestFitGeneration = generation;
- }
- if(worstIndividual == null) {
- worstIndividual = pop.getWorstIndividual();
- worstFitGeneration = generation;
- }
- else if(pop.getWorstFit()> worstIndividual.fitness()){
- worstIndividual = pop.getWorstIndividual();
- worstFitGeneration = generation;
- }
Add Comment
Please, Sign In to add comment