Last change
on this file since 1322 was
1185,
checked in by Maciej Komosinski, 2 years ago
|
Renamed a module; new name is "evolalg_steps"
|
File size:
509 bytes
|
Line | |
---|
1 | from evolalg_steps.statistics.halloffame_custom import HallOfFameCustom |
---|
2 | from evolalg_steps.statistics.statistics import Statistics |
---|
3 | |
---|
4 | |
---|
5 | class HallOfFameStatistics(Statistics): |
---|
6 | def __init__(self, size, fields="fitness", *args, **kwargs): |
---|
7 | super(HallOfFameStatistics, self).__init__(*args, **kwargs) |
---|
8 | self.halloffame = HallOfFameCustom(size, fitness_field=fields) |
---|
9 | |
---|
10 | def init(self): |
---|
11 | self.halloffame.clear() |
---|
12 | |
---|
13 | def collect(self, population): |
---|
14 | self.halloffame.update(population) |
---|
Note: See
TracBrowser
for help on using the repository browser.