source: framspy/evolalg/mutation_cross/frams_cross_and_mutate.py @ 1139

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

Added --debug mode that prints names of steps; final multiple evaluation now evaluates genotypes in hall of fame instead of the last population

File size: 837 bytes
Line 
1from evolalg.base.frams_step import FramsStep
2from evolalg.mutation_cross.frams_cross import FramsCross
3from evolalg.mutation_cross.frams_mutation import FramsMutation
4
5
6class FramsCrossAndMutate(FramsStep):
7    def __init__(self, frams_lib, cross_prob, mutate_prob, mutate_commands=None, cross_commands=None, *args, **kwargs):
8        super().__init__(frams_lib, *args, **kwargs)
9
10        self.cross_prob = cross_prob
11        self.mutate_prob = mutate_prob
12
13        self.frams_mutate = FramsMutation(frams_lib, mutate_commands, mutate_prob)
14        self.frams_cross = FramsCross(frams_lib, cross_commands, cross_prob)
15
16    def call(self, population):
17        super(FramsCrossAndMutate, self).call(population)
18        population = self.frams_cross(population)
19        population = self.frams_mutate(population)
20        return population
Note: See TracBrowser for help on using the repository browser.