source: framspy/evolalg/repair/multistep.py @ 1113

Last change on this file since 1113 was 1113, checked in by Maciej Komosinski, 4 years ago

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

File size: 489 bytes
Line 
1from evolalg.repair.repair import Repair
2import copy
3
4class MultistepRepair(Repair):
5    def __init__(self, selection, steps, excepted_size):
6        super(MultistepRepair, self).__init__(excepted_size)
7        self.selection = selection
8        self.steps = steps
9
10    def generate_new(self, population, missing_count):
11        selected = self.selection(population, missing_count)
12        selected = copy.deepcopy(selected)
13        selected = self.steps(selected)
14        return selected
Note: See TracBrowser for help on using the repository browser.