Changeset 1139 for framspy/evolalg/statistics
- Timestamp:
- 05/08/21 12:42:58 (4 years ago)
- Location:
- framspy/evolalg/statistics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/evolalg/statistics/halloffame_custom.py
r1113 r1139 5 5 6 6 class HallOfFameCustom(HallOfFame): 7 def __init__(self, maxsize, similar=operator.eq, fitness_field="fitness" ):8 super(HallOfFameCustom, self).__init__(maxsize, similar )7 def __init__(self, maxsize, similar=operator.eq, fitness_field="fitness", *args, **kwargs): 8 super(HallOfFameCustom, self).__init__(maxsize, similar, *args, **kwargs) 9 9 print("HOF_size =",self.maxsize) 10 10 self._fitness_field = fitness_field -
framspy/evolalg/statistics/halloffame_stats.py
r1128 r1139 4 4 5 5 class HallOfFameStatistics(Statistics): 6 def __init__(self, size, fields="fitness"): 6 def __init__(self, size, fields="fitness", *args, **kwargs): 7 super(HallOfFameStatistics, self).__init__(*args, **kwargs) 7 8 self.halloffame = HallOfFameCustom(size, fitness_field=fields) 8 9 -
framspy/evolalg/statistics/statistics.py
r1113 r1139 11 11 12 12 def call(self, population): 13 super(Statistics, self).call(population) 13 14 self.collect(population) 14 15 return population -
framspy/evolalg/statistics/statistics_deap.py
r1113 r1139 5 5 6 6 class StatisticsDeap(Statistics): 7 def __init__(self, stats, extract_fn=lambda ind: ind.fitness, verbose=True): 7 def __init__(self, stats, extract_fn=lambda ind: ind.fitness, verbose=True, *args, **kwargs): 8 super(StatisticsDeap, self).__init__(*args, **kwargs) 8 9 self.stats = tools.Statistics(extract_fn) 9 10 for name, fn in stats:
Note: See TracChangeset
for help on using the changeset viewer.