fuzzy_dl_owl2.fuzzydl.query.bnp_query

Encapsulates the calculation of the best non-fuzzy performance for a triangular fuzzy number within a query framework.

Description

The software defines a specific type of query designed to extract a representative crisp value from a triangular fuzzy number, specifically the value with the highest degree of membership known as the best non-fuzzy performance. By inheriting from a generic query interface, it integrates seamlessly into a larger system where various reasoning tasks are standardized, allowing the fuzzy logic calculation to be treated like any other query operation. The implementation delegates the actual mathematical computation to the fuzzy number instance itself, ensuring that the logic for determining the best value remains encapsulated within the data structure. Although the solving mechanism accepts a knowledge base to maintain consistency with other query types, the calculation proceeds independently of the knowledge base contents, relying solely on the properties of the provided fuzzy number. The result is returned wrapped in a solution object, providing a uniform output format for the consuming application.

Classes

BnpQuery

This class encapsulates a query to determine the best non-fuzzy performance (BNP) of a given triangular fuzzy number, which is the specific value within the fuzzy set that possesses the highest degree of membership. It serves as a wrapper around a TriangularFuzzyNumber instance, delegating the calculation of this representative crisp value to the number itself. To utilize this functionality, instantiate the object with the desired fuzzy number and invoke the solve method, which returns a Solution containing the computed BNP. Note that while the solving interface accepts a knowledge base, the current implementation performs the calculation independently of the knowledge base contents.

Module Contents

UML Class Diagram for BnpQuery

UML Class Diagram for BnpQuery

class BnpQuery(c: fuzzy_dl_owl2.fuzzydl.concept.concrete.fuzzy_number.triangular_fuzzy_number.TriangularFuzzyNumber)[source]

Bases: fuzzy_dl_owl2.fuzzydl.query.query.Query

Inheritance diagram of fuzzy_dl_owl2.fuzzydl.query.bnp_query.BnpQuery

This class encapsulates a query to determine the best non-fuzzy performance (BNP) of a given triangular fuzzy number, which is the specific value within the fuzzy set that possesses the highest degree of membership. It serves as a wrapper around a TriangularFuzzyNumber instance, delegating the calculation of this representative crisp value to the number itself. To utilize this functionality, instantiate the object with the desired fuzzy number and invoke the solve method, which returns a Solution containing the computed BNP. Note that while the solving interface accepts a knowledge base, the current implementation performs the calculation independently of the knowledge base contents.

Parameters:

c (TriangularFuzzyNumber) – The triangular fuzzy number for which the best non-fuzzy performance is determined.

__str__() str[source]

Returns a human-readable string representation of the query object, formatted as a label for the best non-fuzzy performance metric. The string includes the name of the computation obtained from the internal component and ends with an equals sign, suggesting it is designed to precede the actual performance value. This method relies on the compute_name method of the internal component and does not modify the object’s state.

Returns:

A string label representing the best non-fuzzy performance metric for the computed name.

Return type:

str

preprocess(kb: fuzzy_dl_owl2.fuzzydl.knowledge_base.KnowledgeBase) None[source]

Prepares the query instance for execution by performing necessary initialization and validation steps using the provided KnowledgeBase. This method typically involves resolving identifiers, checking schema compatibility, or constructing an internal execution plan based on the structure of the knowledge base. It modifies the state of the query object in place and should generally be called once before the main query logic is executed. Subsequent calls may re-initialize the state or be ignored depending on the specific implementation.

Parameters:

kb (KnowledgeBase) – The knowledge base instance to be prepared or transformed for subsequent operations.

solve(kb: fuzzy_dl_owl2.fuzzydl.knowledge_base.KnowledgeBase) fuzzy_dl_owl2.fuzzydl.milp.solution.Solution[source]

Resolves the query by retrieving the best precise performance metric from the internal solver component. It accepts a KnowledgeBase as input to satisfy the solving interface, and returns the identified non-fuzzy result encapsulated within a Solution object.

Parameters:

kb (KnowledgeBase) – The KnowledgeBase instance containing the problem definition or context.

Returns:

A Solution object representing the best non-fuzzy performance.

Return type:

Solution

c: fuzzy_dl_owl2.fuzzydl.concept.concrete.fuzzy_number.triangular_fuzzy_number.TriangularFuzzyNumber