Last change
on this file since 1302 was
1185,
checked in by Maciej Komosinski, 2 years ago
|
Renamed a module; new name is "evolalg_steps"
|
File size:
639 bytes
|
Line | |
---|
1 | from evolalg_steps.base.frams_step import FramsStep |
---|
2 | from evolalg_steps.base.individual import Individual |
---|
3 | |
---|
4 | |
---|
5 | class FramsPopulation(FramsStep): |
---|
6 | def __init__(self, frams_lib, genetic_format, pop_size, commands=None, *args, **kwargs): |
---|
7 | |
---|
8 | if commands is None: |
---|
9 | commands = [] |
---|
10 | super().__init__(frams_lib, commands,*args, **kwargs) |
---|
11 | |
---|
12 | self.pop_size = pop_size |
---|
13 | self.genetic_format = genetic_format |
---|
14 | |
---|
15 | def call(self, population, *args, **kwargs): |
---|
16 | super(FramsPopulation, self).call(population) |
---|
17 | return [Individual(self.frams.getSimplest(self.genetic_format)) for _ in range(self.pop_size)] |
---|
18 | |
---|
Note: See
TracBrowser
for help on using the repository browser.