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

TerminationConditionInterface.satisfied()   A

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 2
dl 0
loc 11
rs 10
c 0
b 0
f 0
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