gradient_free_optimizers._search_statistics   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A SearchStatistics.init_stats() 0 9 1
A SearchStatistics.__init__() 0 7 1
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
6
class SearchStatistics:
7
    def __init__(self):
8
        super().__init__()
9
10
        self.nth_iter = 0
11
12
        self.n_init_total = 0
13
        self.n_iter_total = 0
14
15
    def init_stats(func):
16
        def wrapper(self, *args, **kwargs):
17
            self.n_init_search = 0
18
            self.n_iter_search = 0
19
20
            res = func(self, *args, **kwargs)
21
            return res
22
23
        return wrapper
24