| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import numpy as np |
||
| 2 | |||
| 3 | |||
| 4 | def get_score(pos_new): |
||
| 5 | return -(pos_new[0] * pos_new[0]) |
||
| 6 | |||
| 7 | |||
| 8 | search_space = [np.arange(-100, 100, 1)] |
||
| 9 | |||
| 10 | |||
| 11 | def _base_test( |
||
| 12 | opt_class, n_iter, get_score=get_score, search_space=search_space, opt_para={}, |
||
| 13 | ): |
||
| 14 | opt = opt_class(search_space, **opt_para) |
||
| 15 | opt.search(get_score, n_iter=n_iter) |
||
| 16 | |||
| 17 |