eckity.individual
1from copy import deepcopy 2 3from eckity.fitness.fitness import Fitness 4 5 6class Individual: 7 def __init__(self, fitness: Fitness): 8 self.fitness = fitness 9 10 def set_fitness_not_evaluated(self): 11 self.fitness.set_not_evaluated() 12 13 def clone(self): 14 return deepcopy(self) 15 16 def get_pure_fitness(self): 17 return self.fitness.get_pure_fitness() 18 19 def get_augmented_fitness(self): 20 return self.fitness.get_augmented_fitness(self) 21 22 def better_than(self, other): 23 if other is None: 24 return True 25 26 return self.fitness.better_than(self, other.fitness, other)
class
Individual:
7class Individual: 8 def __init__(self, fitness: Fitness): 9 self.fitness = fitness 10 11 def set_fitness_not_evaluated(self): 12 self.fitness.set_not_evaluated() 13 14 def clone(self): 15 return deepcopy(self) 16 17 def get_pure_fitness(self): 18 return self.fitness.get_pure_fitness() 19 20 def get_augmented_fitness(self): 21 return self.fitness.get_augmented_fitness(self) 22 23 def better_than(self, other): 24 if other is None: 25 return True 26 27 return self.fitness.better_than(self, other.fitness, other)
Individual(fitness: eckity.fitness.fitness.Fitness)