Completed
Push — master ( 40c094...b6a1c4 )
by Wojtek
02:30
created

GroupOptimizationStrategy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
rs 10
ccs 3
cts 5
cp 0.6
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A should_continue() 0 12 1
A initialize() 0 9 1
1
"""Represents optimization strategy for group in PSO."""
2
3
4 1
class GroupOptimizationStrategy:
0 ignored issues
show
Complexity introduced by
This abstract class seems to be used only once.

Abstract classes which are used only once can usually be inlined into the class which already uses this abstract class.

Loading history...
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