Passed
Push — master ( ee1e78...515b92 )
by Konstantinos
01:14
created

artificial_artwork.termination_condition.termination_condition_interface   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A TerminationConditionInterface.satisfied() 0 11 1
1
from abc import ABC, abstractmethod
2
from typing import TypeVar, Generic
3
4
T = TypeVar('T')
5
6
7
class TerminationConditionInterface(ABC, Generic[T]):
8
    """A condition that evaluates to True or False.
9
10
    If True it should indicate that something should now terminate.
11
    """
12
    @abstractmethod
13
    def satisfied(self, progress: T) -> bool:
14
        """Check if the termination condition is True.
15
16
        Args:
17
            progress ([type]): [description]
18
19
        Returns:
20
            bool: True if the termination condition is satisfied, else False
21
        """
22
        raise NotImplementedError
23