Changeset 1139 for framspy/evolalg/repair
- Timestamp:
- 05/08/21 12:42:58 (4 years ago)
- Location:
- framspy/evolalg/repair
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/evolalg/repair/const.py
r1113 r1139 5 5 6 6 class 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) 9 9 self.value = value 10 10 -
framspy/evolalg/repair/halloffame_repair.py
r1113 r1139 6 6 7 7 class 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) 10 10 self.halloffame = halloffame 11 11 self.top = top -
framspy/evolalg/repair/multistep.py
r1113 r1139 3 3 4 4 class 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) 7 7 self.selection = selection 8 8 self.steps = steps -
framspy/evolalg/repair/mutate.py
r1113 r1139 6 6 7 7 class 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) 10 10 self.mutate_step = mutate_step 11 11 self.iterations = iterations -
framspy/evolalg/repair/remove/field.py
r1113 r1139 3 3 4 4 class 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) 7 7 self.field_name = field_name 8 8 self.field_value = field_value -
framspy/evolalg/repair/remove/function.py
r1113 r1139 3 3 from evolalg.repair.remove.remove import Remove 4 4 class 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) 7 7 self.func = func 8 8 -
framspy/evolalg/repair/remove/remove.py
r1113 r1139 5 5 6 6 class Remove(Step): 7 def __init__(self): 7 def __init__(self, *args, **kwargs): 8 super(Remove, self).__init__(*args , **kwargs) 8 9 pass 9 10 … … 13 14 14 15 def call(self, population): 16 super(Remove, self).call(population) 15 17 return [_ for _ in population if not self.remove(_)] -
framspy/evolalg/repair/repair.py
r1113 r1139 6 6 7 7 class Repair(Step): 8 def __init__(self, excepted_size): 8 def __init__(self, excepted_size, *args, **kwargs): 9 super(Repair, self).__init__(*args, **kwargs) 9 10 self.excepted_size = excepted_size 10 11 … … 14 15 15 16 def call(self, population): 17 super(Repair, self).call(population) 16 18 generated = [] 17 19 while len(generated) + len(population) < self.excepted_size:
Note: See TracChangeset
for help on using the changeset viewer.