fuzzy_dl_owl2.fuzzydl.query.defuzzify.som_defuzzify_query

Implements the Smallest of Maxima defuzzification strategy to convert fuzzy logic values into crisp numerical outputs.

Description

The software defines a specific approach to resolving fuzzy values by identifying the smallest domain value that achieves the maximum membership degree for a given individual and concept. By extending a base query structure, it integrates into a broader fuzzy logic framework that utilizes Mixed-Integer Linear Programming to solve reasoning tasks. The implementation focuses on constructing an objective expression that minimizes the query variable, effectively steering the optimization process toward the smallest valid maximum. This behavior ensures that when multiple domain values share the highest degree of membership, the system consistently selects the lowest one to produce a deterministic crisp result.

Classes

SomDefuzzifyQuery

This class implements the Smallest of Maxima (SOM) defuzzification strategy, a method used to convert fuzzy logic values into crisp, numerical outputs. It operates by identifying the domain values that correspond to the highest degree of membership for a specific individual within a given concept and selecting the smallest among those maxima. The query is constructed using a target concept, an individual instance, and a feature name, which define the scope of the fuzzy evaluation. As a subclass of DefuzzifyQuery, it provides a specific implementation for resolving feature values based on the SOM algorithm within a larger fuzzy logic framework.

Module Contents

UML Class Diagram for SomDefuzzifyQuery

UML Class Diagram for SomDefuzzifyQuery

class SomDefuzzifyQuery(
c: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept,
ind: fuzzy_dl_owl2.fuzzydl.individual.individual.Individual,
f_name: str,
)

Bases: fuzzy_dl_owl2.fuzzydl.query.defuzzify.defuzzify_query.DefuzzifyQuery

Inheritance diagram of fuzzy_dl_owl2.fuzzydl.query.defuzzify.som_defuzzify_query.SomDefuzzifyQuery

This class implements the Smallest of Maxima (SOM) defuzzification strategy, a method used to convert fuzzy logic values into crisp, numerical outputs. It operates by identifying the domain values that correspond to the highest degree of membership for a specific individual within a given concept and selecting the smallest among those maxima. The query is constructed using a target concept, an individual instance, and a feature name, which define the scope of the fuzzy evaluation. As a subclass of DefuzzifyQuery, it provides a specific implementation for resolving feature values based on the SOM algorithm within a larger fuzzy logic framework.

__str__() str

Returns a human-readable string representation of the defuzzification query, specifically formatted to describe a “Smallest of the maxima” operation. The string dynamically includes the feature name and instance identifier stored in the object, providing context for the specific calculation being represented. This method is primarily used for logging or display purposes, outputting a descriptive label that concludes with an equals sign.

Returns:

A string representation describing the smallest of the maxima defuzzification for the specific feature and instance.

Return type:

str

get_obj_expression(q: fuzzy_dl_owl2.fuzzydl.milp.variable.Variable) fuzzy_dl_owl2.fuzzydl.milp.expression.Expression

Constructs a linear expression representing the provided variable with a coefficient of 1.0. The method encapsulates the variable within a Term object assigned a unit weight and wraps it in an Expression structure, effectively creating a mathematical representation of the variable itself. This function is stateless and produces no side effects on the instance or the input variable, though it assumes the input is a valid Variable object to prevent errors during Term instantiation.

Parameters:

q (Variable) – The variable used to construct the objective expression.

Returns:

An Expression object representing the variable q with a coefficient of 1.0.

Return type:

Expression