fuzzy_dl_owl2.fuzzydl.concept.interface.has_weighted_concepts_interface
An abstract interface that extends concept management to include associated numerical weights.
Description
Building upon the foundation of managing collections of concepts, this abstract base class introduces the capability to associate numerical weights with those concepts. It enforces a contract where implementing classes must handle a list of floating-point values that correspond to the managed concepts, allowing for dynamic representation of magnitude or significance. The design ensures that weights are stored internally as mutable lists or explicitly set to null, providing flexibility for scenarios where weighting is optional or conditional. By offering properties to retrieve and modify these values, the interface facilitates the seamless integration of weighted logic into complex fuzzy description logic structures.
Classes
This abstract base class defines a contract for objects that manage a collection of concepts alongside associated numerical weights, extending the functionality of the basic concept interface. It provides properties to retrieve and update the list of weights, ensuring that these values are stored as mutable lists of floats or explicitly set to null to indicate the absence of weighting. By handling the initialization and modification of these weights, the class enables dynamic representation of concepts where each element carries a specific magnitude or significance. |
Module Contents
UML Class Diagram for HasWeightedConceptsInterface
- class HasWeightedConceptsInterface(
- weights: Iterable[float] | None,
- concepts: Iterable[fuzzy_dl_owl2.fuzzydl.concept.concept.Concept],
Bases:
fuzzy_dl_owl2.fuzzydl.concept.interface.has_concepts_interface.HasConceptsInterface,abc.ABC
This abstract base class defines a contract for objects that manage a collection of concepts alongside associated numerical weights, extending the functionality of the basic concept interface. It provides properties to retrieve and update the list of weights, ensuring that these values are stored as mutable lists of floats or explicitly set to null to indicate the absence of weighting. By handling the initialization and modification of these weights, the class enables dynamic representation of concepts where each element carries a specific magnitude or significance.
- Parameters:
_weights (Optional[list[float]]) – Internal list of weights associated with the current concepts, or None if no weights are assigned.
- _weights: list[float] | None
- property weights: list[float] | None
Sets the weights for the instance, replacing any existing values. The method accepts an optional iterable of floats; if a value is provided, it is converted to a list and assigned to the internal storage. Passing None explicitly sets the internal weights to None, effectively clearing them.
- Parameters:
value (Optional[Iterable[float]]) – An iterable of floating-point values representing the weights. If None, the weights are reset.