Last change
on this file since 1310 was
1185,
checked in by Maciej Komosinski, 2 years ago
|
Renamed a module; new name is "evolalg_steps"
|
File size:
436 bytes
|
Line | |
---|
1 | from evolalg_steps.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.