Passed
Push — master ( 07671f...674edd )
by Simon
03:40
created

BasePopulationOptimizer.finish_initialization()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import numpy as np
6
from ...converter import Converter
7
from ...results_manager import ResultsManager
8
9
10
class BasePopulationOptimizer:
11
    def __init__(
12
        self,
13
        search_space,
14
        initialize={"grid": 4, "random": 2, "vertices": 4},
15
    ):
16
        super().__init__()
17
        self.conv = Converter(search_space)
18
        self.results_mang = ResultsManager(self.conv)
19
        self.initialize = initialize
20
21
        self.eval_times = []
22
        self.iter_times = []
23
24
    def _iterations(self, positioners):
25
        nth_iter = 0
26
        for p in positioners:
27
            nth_iter = nth_iter + len(p.pos_new_list)
28
29
        return nth_iter
30
31
    def finish_initialization(self):
32
        pass