Last change
on this file since 1254 was
1185,
checked in by Maciej Komosinski, 2 years ago
|
Renamed a module; new name is "evolalg_steps"
|
File size:
410 bytes
|
Rev | Line | |
---|
[1113] | 1 | from abc import abstractmethod |
---|
[1185] | 2 | from evolalg_steps.base.step import Step |
---|
[1113] | 3 | |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | class Remove(Step): |
---|
[1139] | 7 | def __init__(self, *args, **kwargs): |
---|
| 8 | super(Remove, self).__init__(*args , **kwargs) |
---|
[1113] | 9 | pass |
---|
| 10 | |
---|
| 11 | @abstractmethod |
---|
| 12 | def remove(self, individual): |
---|
| 13 | pass |
---|
| 14 | |
---|
| 15 | def call(self, population): |
---|
[1139] | 16 | super(Remove, self).call(population) |
---|
[1113] | 17 | return [_ for _ in population if not self.remove(_)] |
---|
Note: See
TracBrowser
for help on using the repository browser.