finish functional genetic algorithm