Source code for base.base_domain_metric
"""
Metric specification for an interval/set.
"""
[docs]class BaseDomainMetric:
"""
Abstract class for creating 'metric' static classes,
which prescribe how to deal with the concept of interval "length" and
their summations.
"""
def __init__(self):
raise RuntimeError("This class is static.")
[docs] @staticmethod
def adder(val1, val2): # noqa: PLW0613
"""How to add two 'extensions' to get another 'extension'."""
[docs] @staticmethod
def subtracter(val1, val2): # noqa: PLW0613
"""
How to subtract two ends of an interval (peg values)
to get its 'extension'.
"""
"""What is the 'zero extension' when computing the extension of a set.""" # noqa: PLW0105, E501
zero = ...