source: framspy/evolalg/repair/remove/field.py @ 1113

Last change on this file since 1113 was 1113, checked in by Maciej Komosinski, 19 months ago

Added a framework for evolutionary algorithms cooperating with FramsticksLib?.py

File size: 398 bytes
Line 
1from evolalg.repair.remove.remove import Remove
2
3
4class FieldRemove(Remove):
5    def __init__(self, field_name, field_value):
6        super(FieldRemove, self).__init__()
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.