GroupOptimizationStrategy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 38
ccs 4
cts 6
cp 0.6667
rs 10
c 2
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A should_continue() 0 12 1
A initialize() 0 9 1
A finalize() 0 12 1
1
"""Represents optimization strategy for group in PSO."""
2
3
4 1
class GroupOptimizationStrategy:
5
    """Represents optimization strategy for group in PSO."""
6
7 1
    @staticmethod
8
    def initialize():
9
        """
10
        Initialize strategy.
11
12
        Raises:
13
            NotImplementedError: if not  implemented.
14
        """
15
        raise NotImplementedError
16
17 1
    @staticmethod
18
    def should_continue(best_particle):
19
        """
20
        Strategic method.
21
22
        Args:
23
            best_particle (Particle): best particle in swarm
24
25
        Raises:
26
            NotImplementedError: if not implemented.
27
        '"""
28
        raise NotImplementedError
29
30 1
    @staticmethod
31
    def finalize(best_particle):
32
        """
33
        Strategic method which must set correct status for all stages.
34
35
        Args:
36
            best_particle (Particle): best particle in swarm
37
38
        Raises:
39
            NotImplementedError: if not implemented.
40
41
        """
42