Total Complexity | 3 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 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 |