Passed
Push — master ( d39371...69bf6f )
by Simon
03:38
created

BasePopulationOptimizer.__init__()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 2
dl 0
loc 6
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
7
8
class BasePopulationOptimizer:
9
    def __init__(self, search_space):
10
        self.search_space = search_space
11
        self.space_dim = np.array([array.size - 1 for array in search_space])
12
13
        self.eval_times = []
14
        self.iter_times = []
15
16
    def _iterations(self, positioners):
17
        nth_iter = 0
18
        for p in positioners:
19
            nth_iter = nth_iter + len(p.pos_new_list)
20
21
        return nth_iter
22