|
Last change
on this file since 1320 was
1185,
checked in by Maciej Komosinski, 3 years ago
|
|
Renamed a module; new name is "evolalg_steps"
|
|
File size:
529 bytes
|
| Rev | Line | |
|---|
| [1185] | 1 | from evolalg_steps.repair.repair import Repair |
|---|
| [1113] | 2 | import copy |
|---|
| 3 | |
|---|
| 4 | class MultistepRepair(Repair): |
|---|
| [1139] | 5 | def __init__(self, selection, steps, excepted_size, *args, **kwargs): |
|---|
| 6 | super(MultistepRepair, self).__init__(excepted_size, *args, **kwargs) |
|---|
| [1113] | 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.