fuzzy_dl_owl2.fuzzydl.query.bnp_query

Encapsulates a query to calculate the best non-fuzzy performance value for a specific triangular fuzzy number.

Description

Extending the generic query interface, the logic specializes in deriving a representative crisp value from a fuzzy set, specifically targeting the point of maximum membership known as the best non-fuzzy performance. By wrapping a triangular fuzzy number instance, the implementation delegates the actual computation to the number itself, ensuring that the mathematical determination of the optimal value remains encapsulated within the data structure. While the solving mechanism accepts a knowledge base argument to maintain consistency with the broader system architecture, the calculation is performed independently of the knowledge base contents or schema. The result is packaged into a standardized solution object, allowing the computed metric to be integrated seamlessly into larger workflows or result processing pipelines.

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)

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

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

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

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