Last change
on this file since 1161 was
1139,
checked in by Maciej Komosinski, 4 years ago
|
Added --debug mode that prints names of steps; final multiple evaluation now evaluates genotypes in hall of fame instead of the last population
|
File size:
430 bytes
|
Line | |
---|
1 | from evolalg.repair.remove.remove import Remove |
---|
2 | |
---|
3 | |
---|
4 | class FieldRemove(Remove): |
---|
5 | def __init__(self, field_name, field_value, *args, **kwargs): |
---|
6 | super(FieldRemove, self).__init__(*args, **kwargs) |
---|
7 | self.field_name = field_name |
---|
8 | self.field_value = field_value |
---|
9 | |
---|
10 | def remove(self, individual): |
---|
11 | return not hasattr(individual, self.field_name) or getattr(individual, self.field_name) == self.field_value |
---|
12 | |
---|
Note: See
TracBrowser
for help on using the repository browser.