Ignore:
Timestamp:
05/08/21 12:42:58 (4 years ago)
Author:
Maciej Komosinski
Message:

Added --debug mode that prints names of steps; final multiple evaluation now evaluates genotypes in hall of fame instead of the last population

Location:
framspy/evolalg/repair
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • framspy/evolalg/repair/const.py

    r1113 r1139  
    55
    66class ConstRepair(Repair):
    7     def __init__(self, value, excepted_size):
    8         super(ConstRepair, self).__init__(excepted_size)
     7    def __init__(self, value, excepted_size, *args, **kwargs):
     8        super(ConstRepair, self).__init__(excepted_size, *args, **kwargs)
    99        self.value = value
    1010
  • framspy/evolalg/repair/halloffame_repair.py

    r1113 r1139  
    66
    77class HallOfFameRepair(Repair):
    8     def __init__(self, excepted_size, halloffame, top):
    9         super(HallOfFameRepair, self).__init__(excepted_size)
     8    def __init__(self, excepted_size, halloffame, top, *args, **kwargs):
     9        super(HallOfFameRepair, self).__init__(excepted_size, *args, **kwargs)
    1010        self.halloffame = halloffame
    1111        self.top = top
  • framspy/evolalg/repair/multistep.py

    r1113 r1139  
    33
    44class MultistepRepair(Repair):
    5     def __init__(self, selection, steps, excepted_size):
    6         super(MultistepRepair, self).__init__(excepted_size)
     5    def __init__(self, selection, steps, excepted_size, *args, **kwargs):
     6        super(MultistepRepair, self).__init__(excepted_size, *args, **kwargs)
    77        self.selection = selection
    88        self.steps = steps
  • framspy/evolalg/repair/mutate.py

    r1113 r1139  
    66
    77class MutateRepair(Repair):
    8     def __init__(self, mutate_step, excepted_size, iterations=1):
    9         super(MutateRepair, self).__init__(excepted_size)
     8    def __init__(self, mutate_step, excepted_size, iterations=1, *args, **kwargs):
     9        super(MutateRepair, self).__init__(excepted_size, *args, **kwargs)
    1010        self.mutate_step = mutate_step
    1111        self.iterations = iterations
  • framspy/evolalg/repair/remove/field.py

    r1113 r1139  
    33
    44class FieldRemove(Remove):
    5     def __init__(self, field_name, field_value):
    6         super(FieldRemove, self).__init__()
     5    def __init__(self, field_name, field_value, *args, **kwargs):
     6        super(FieldRemove, self).__init__(*args, **kwargs)
    77        self.field_name = field_name
    88        self.field_value = field_value
  • framspy/evolalg/repair/remove/function.py

    r1113 r1139  
    33from evolalg.repair.remove.remove import Remove
    44class LambdaRemove(Remove):
    5     def __init__(self, func):
    6         super(LambdaRemove, self).__init__()
     5    def __init__(self, func, *args, **kwargs):
     6        super(LambdaRemove, self).__init__(*args, **kwargs)
    77        self.func = func
    88
  • framspy/evolalg/repair/remove/remove.py

    r1113 r1139  
    55
    66class Remove(Step):
    7     def __init__(self):
     7    def __init__(self, *args, **kwargs):
     8        super(Remove, self).__init__(*args , **kwargs)
    89        pass
    910
     
    1314
    1415    def call(self, population):
     16        super(Remove, self).call(population)
    1517        return [_ for _ in population if not self.remove(_)]
  • framspy/evolalg/repair/repair.py

    r1113 r1139  
    66
    77class Repair(Step):
    8     def __init__(self, excepted_size):
     8    def __init__(self, excepted_size, *args, **kwargs):
     9        super(Repair, self).__init__(*args, **kwargs)
    910        self.excepted_size = excepted_size
    1011
     
    1415
    1516    def call(self, population):
     17        super(Repair, self).call(population)
    1618        generated = []
    1719        while len(generated) + len(population) < self.excepted_size:
Note: See TracChangeset for help on using the changeset viewer.