Ignore:
Timestamp:
05/08/21 12:42:58 (4 years ago)
Author:
Maciej Komosinski
Message:

Added --debug mode that prints names of steps; final multiple evaluation now evaluates genotypes in hall of fame instead of the last population

Location:
framspy/evolalg/statistics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • framspy/evolalg/statistics/halloffame_custom.py

    r1113 r1139  
    55
    66class 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)
    99        print("HOF_size =",self.maxsize)
    1010        self._fitness_field = fitness_field
  • framspy/evolalg/statistics/halloffame_stats.py

    r1128 r1139  
    44
    55class 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)
    78        self.halloffame = HallOfFameCustom(size, fitness_field=fields)
    89
  • framspy/evolalg/statistics/statistics.py

    r1113 r1139  
    1111
    1212    def call(self, population):
     13        super(Statistics, self).call(population)
    1314        self.collect(population)
    1415        return population
  • framspy/evolalg/statistics/statistics_deap.py

    r1113 r1139  
    55
    66class 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)
    89        self.stats = tools.Statistics(extract_fn)
    910        for name, fn in stats:
Note: See TracChangeset for help on using the changeset viewer.