Module src.olaaaf.distance.distance_function.distanceFunction

Abstract class representing a distance function.

Classes

class DistanceFunction (domain: Domain)

Abstract class representing a distance function.

Parameters

domain : olaaaf.distance.domain.domain.Domain
The olaaaf.distance.domain.domain.Domain on which the distance function is defined.
Expand source code
class DistanceFunction(ABC):
    """
    Abstract class representing a distance function.

    Parameters
    ----------
    domain: olaaaf.distance.domain.domain.Domain
        The `olaaaf.distance.domain.domain.Domain` on which the distance function is defined.
    """
    
    _domain : Domain

    def __init__(self, domain : Domain):
        self._domain = domain
    
    @abstractmethod
    def dist(x: tuple[Variable], y: tuple[Variable]) -> Fraction:
        r"""
        Main method of a distance funciton, allowing to get the distance between two points \(x\) and \(y\).

        Parameters
        ----------
        x, y : tuple of olaaaf.variable.variable.Variable
            The two tuples of `olaaaf.variable.variable.Variable` you which to get the distance between.

        Returns
        -------
        fractions.Fraction
            The distance between \(x\) and \(y\).
        """

        pass

Ancestors

  • abc.ABC

Subclasses

Methods

def dist(x: tuple[Variable], y: tuple[Variable]) ‑> fractions.Fraction

Main method of a distance funciton, allowing to get the distance between two points x and y.

Parameters

x, y : tuple of olaaaf.variable.variable.Variable
The two tuples of olaaaf.variable.variable.Variable you which to get the distance between.

Returns

fractions.Fraction
The distance between x and y.