source: framspy/evolalg/statistics/halloffame_stats.py @ 1128

Last change on this file since 1128 was 1128, checked in by Maciej Komosinski, 3 years ago

Introduced the number of generations as a command-line parameter; refactored; fixed a typo

File size: 412 bytes
Line 
1from evolalg.statistics.halloffame_custom import HallOfFameCustom
2from evolalg.statistics.statistics import Statistics
3
4
5class HallOfFameStatistics(Statistics):
6    def __init__(self, size, fields="fitness"):
7        self.halloffame = HallOfFameCustom(size, fitness_field=fields)
8
9    def init(self):
10        self.halloffame.clear()
11
12    def collect(self, population):
13        self.halloffame.update(population)
Note: See TracBrowser for help on using the repository browser.