Last change
on this file since 1138 was
1128,
checked in by Maciej Komosinski, 4 years ago
|
Introduced the number of generations as a command-line parameter; refactored; fixed a typo
|
File size:
412 bytes
|
Line | |
---|
1 | from evolalg.statistics.halloffame_custom import HallOfFameCustom |
---|
2 | from evolalg.statistics.statistics import Statistics |
---|
3 | |
---|
4 | |
---|
5 | class 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.