GeneticAlgorithm.py 593 B

12345678910111213141516171819
  1. from Include.Gantt1 import my_gantt
  2. from Include.Individual import GeneticAlgorithm
  3. class MyGeneticAlgorithm(GeneticAlgorithm):
  4. def run(self):
  5. self.initialize_connect_class()
  6. self.get_boys()
  7. self.get_fitness()
  8. for _ in range(self.generate_number):
  9. print(self.boys.iloc[0, -1])
  10. if len(self.duplicate_removal(self.boys['name'].values.tolist())) < 2:
  11. break
  12. self.selection()
  13. self.crossover()
  14. self.get_fitness()
  15. self.marshaling_result()
  16. my_gantt()