Line | |
---|
1 | from evolalg.base.frams_step import FramsStep |
---|
2 | from evolalg.base.individual import Individual |
---|
3 | |
---|
4 | |
---|
5 | class FramsPopulation(FramsStep): |
---|
6 | def __init__(self, frams_lib, genetic_format, pop_size, commands=None): |
---|
7 | if commands is None: |
---|
8 | commands = [] |
---|
9 | super().__init__(frams_lib, commands) |
---|
10 | |
---|
11 | self.pop_size = pop_size |
---|
12 | self.genetic_format = genetic_format |
---|
13 | |
---|
14 | def call(self, *args, **kwargs): |
---|
15 | return [Individual(self.frams.getSimplest(self.genetic_format)) for _ in range(self.pop_size)] |
---|
16 | |
---|
Note: See
TracBrowser
for help on using the repository browser.