Пример #1
0
    def __init__(self, config: PopulationConfig, reporters):
        self.reporters = reporters
        self.specie_elites = dict()

        self.species_fitness_func = stat_functions.get(config.fitness_func)
        if self.species_fitness_func is None:
            raise RuntimeError(
                f"Unexpected species fitness func: {config.fitness_func!r}")
Пример #2
0
    def __init__(self, config, reporters):
        # pylint: disable=super-init-not-called
        self.stagnation_config = config

        self.species_fitness_func = stat_functions.get(config.species_fitness_func)
        if self.species_fitness_func is None:
            raise RuntimeError(
                "Unexpected species fitness func: {0!r}".format(config.species_fitness_func))

        self.reporters = reporters
Пример #3
0
    def __init__(self, config, reporters):
        self.max_stagnation = int(config.get('max_stagnation'))
        self.species_fitness = config.get('species_fitness_func')
        self.species_elitism = int(config.get('species_elitism'))

        self.species_fitness_func = stat_functions.get(self.species_fitness)
        if self.species_fitness_func is None:
            raise Exception("Unexpected species fitness: {0!r}".format(self.species_fitness))

        self.reporters = reporters