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
|
Rev | Line | |
---|
[1113] | 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"): |
---|
[1128] | 7 | self.halloffame = HallOfFameCustom(size, fitness_field=fields) |
---|
[1113] | 8 | |
---|
| 9 | def init(self): |
---|
[1128] | 10 | self.halloffame.clear() |
---|
[1113] | 11 | |
---|
| 12 | def collect(self, population): |
---|
[1128] | 13 | self.halloffame.update(population) |
---|
Note: See
TracBrowser
for help on using the repository browser.