source: framspy/evolalg/population/frams_population.py @ 1113

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

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

File size: 527 bytes
RevLine 
[1113]1from evolalg.base.frams_step import FramsStep
2from evolalg.base.individual import Individual
3
4
5class 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.