source: framspy/evolalg/base/union_step.py @ 1114

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

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

File size: 370 bytes
RevLine 
[1113]1from collections import Iterable
2
3from evolalg.base.step import Step
4
5
6class UnionStep(Step):
7    def __init__(self, steps):
8        if isinstance(steps, Iterable):
9            self.steps = steps
10        else:
11            self.steps = [steps]
12
13    def call(self, population):
14        for s in self.steps:
15            population = s(population)
16        return population
Note: See TracBrowser for help on using the repository browser.