Last change
on this file since 1170 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:
826 bytes
|
Line | |
---|
1 | from typing import Dict, List |
---|
2 | |
---|
3 | from evolalg.base.individual import Individual |
---|
4 | from evolalg.fitness.fitness_step import FitnessStep |
---|
5 | import copy |
---|
6 | |
---|
7 | class MultipleEvaluationFitness(FitnessStep): |
---|
8 | def __init__(self, frams_lib, fields: Dict, fields_defaults: Dict, commands: List[str] = None, |
---|
9 | vectorized: bool = True, number_evaluations = 10, *args, **kwargs): |
---|
10 | super().__init__(frams_lib, fields, fields_defaults, commands, vectorized, *args, **kwargs) |
---|
11 | self.number_evaluations = number_evaluations |
---|
12 | |
---|
13 | |
---|
14 | def call(self, population: List[Individual]): |
---|
15 | super(MultipleEvaluationFitness, self).call(population) |
---|
16 | pop = copy.deepcopy(population) |
---|
17 | statistics = [{} for _ in range(len(population))] |
---|
18 | for _ in self.number_evaluations: |
---|
19 | pass |
---|
20 | return population |
---|
Note: See
TracBrowser
for help on using the repository browser.