Skip to content

termination_condition_interface

TerminationConditionInterface

Bases: ABC, Generic[T]

A condition that evaluates to True or False.

If True it should indicate that something should now terminate.

Source code in src/artificial_artwork/termination_condition/termination_condition_interface.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class TerminationConditionInterface(ABC, Generic[T]):
    """A condition that evaluates to True or False.

    If True it should indicate that something should now terminate.
    """

    @abstractmethod
    def satisfied(self, progress: T) -> bool:
        """Check if the termination condition is True.

        Args:
            progress ([type]): [description]

        Returns:
            bool: True if the termination condition is satisfied, else False
        """
        raise NotImplementedError

satisfied(progress) abstractmethod

Check if the termination condition is True.

Parameters:

Name Type Description Default
progress [type]

[description]

required

Returns:

Name Type Description
bool bool

True if the termination condition is satisfied, else False

Source code in src/artificial_artwork/termination_condition/termination_condition_interface.py
13
14
15
16
17
18
19
20
21
22
23
@abstractmethod
def satisfied(self, progress: T) -> bool:
    """Check if the termination condition is True.

    Args:
        progress ([type]): [description]

    Returns:
        bool: True if the termination condition is satisfied, else False
    """
    raise NotImplementedError