source: framspy/evolalg/repair/const.py @ 1139

Last change on this file since 1139 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: 344 bytes
RevLine 
[1113]1import copy
2
3from evolalg.repair.repair import Repair
4
5
6class ConstRepair(Repair):
[1139]7    def __init__(self, value, excepted_size, *args, **kwargs):
8        super(ConstRepair, self).__init__(excepted_size, *args, **kwargs)
[1113]9        self.value = value
10
11    def generate_new(self, population, missing_count):
12        return copy.deepcopy(self.value)
Note: See TracBrowser for help on using the repository browser.