net.sourceforge.fuzzyservices.beans
Class FuzzySet

java.lang.Object
  extended by net.sourceforge.fuzzyservices.beans.FuzzySet
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener

public class FuzzySet
extends Object
implements Serializable, PropertyChangeListener

This class represents a fuzzy setDegreeOfMembership according to JavaBeans conventions.

Version:
1.0
Author:
Uwe Weng
See Also:
FuzzySet, Serialized Form

Field Summary
static String CONVEX_PROPERTY
          Bound property name for convex.
static String HEIGHT_PROPERTY
          Bound property name for height.
static String MEMBERSHIP_FUNCTION_PROPERTY
          Bound property name for membershipFunction.
static String NORMALIZED_PROPERTY
          Bound property name for normalized.
static String VALID_FUZZY_INTERVAL_PROPERTY
          Bound property name for validFuzzyInterval.
static String VALID_FUZZY_LR_INTERVAL_PROPERTY
          Bound property name for validFuzzyLRInterval.
static String VALID_FUZZY_LR_NUMBER_PROPERTY
          Bound property name for validFuzzyLRNumber.
static String VALID_FUZZY_NUMBER_PROPERTY
          Bound property name for validFuzzyLRNumber.
 
Constructor Summary
FuzzySet()
          Default FuzzySet constructor.
FuzzySet(MembershipFunction newMembershipFunction)
          Creates a new FuzzySet.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 Object clone()
           
 void concentrate()
          Concentrates this fuzzy setDegreeOfMembership.
 void dilate()
          Dilates this fuzzy setDegreeOfMembership.
 boolean equals(Object obj)
           
 float getHeight()
          Returns the height of this fuzzy set.
 int getId()
          Returns the technical identifier (e.g. within a database).
 MembershipFunction getMembershipFunction()
          Returns the membership function.
 int hashCode()
           
 boolean isConvex()
          Checks whether the membership function is convex.
 boolean isNormalized()
          Checks whether the membership function is normalized.
 boolean isValidFuzzyInterval()
          Checks whether the fuzzy set fulfills the requirements of a fuzzy interval.
 boolean isValidFuzzyLRInterval()
          Checks whether the fuzzy set fulfills the requirements of a fuzzy LR interval.
 boolean isValidFuzzyLRNumber()
          Checks whether the fuzzy set fulfills the requirements of a fuzzy LR number.
 boolean isValidFuzzyNumber()
          Checks whether the fuzzy set fulfills the requirements of a fuzzy number.
 void normalize()
          Normalizes this fuzzy set.
 void propertyChange(PropertyChangeEvent evt)
           
 void reciproce()
          Computes the reciproce fuzzy set.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void setMembershipFunction(MembershipFunction newMembershipFunction)
          Sets the membership function.
 String toString()
           
 String toString(boolean withMembershipFunction)
          Returns a textual representation of the fuzzy set
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MEMBERSHIP_FUNCTION_PROPERTY

public static final String MEMBERSHIP_FUNCTION_PROPERTY
Bound property name for membershipFunction.

See Also:
Constant Field Values

CONVEX_PROPERTY

public static final String CONVEX_PROPERTY
Bound property name for convex.

See Also:
Constant Field Values

HEIGHT_PROPERTY

public static final String HEIGHT_PROPERTY
Bound property name for height.

See Also:
Constant Field Values

NORMALIZED_PROPERTY

public static final String NORMALIZED_PROPERTY
Bound property name for normalized.

See Also:
Constant Field Values

VALID_FUZZY_NUMBER_PROPERTY

public static final String VALID_FUZZY_NUMBER_PROPERTY
Bound property name for validFuzzyLRNumber.

See Also:
Constant Field Values

VALID_FUZZY_LR_NUMBER_PROPERTY

public static final String VALID_FUZZY_LR_NUMBER_PROPERTY
Bound property name for validFuzzyLRNumber.

See Also:
Constant Field Values

VALID_FUZZY_INTERVAL_PROPERTY

public static final String VALID_FUZZY_INTERVAL_PROPERTY
Bound property name for validFuzzyInterval.

See Also:
Constant Field Values

VALID_FUZZY_LR_INTERVAL_PROPERTY

public static final String VALID_FUZZY_LR_INTERVAL_PROPERTY
Bound property name for validFuzzyLRInterval.

See Also:
Constant Field Values
Constructor Detail

FuzzySet

public FuzzySet()
Default FuzzySet constructor.


FuzzySet

public FuzzySet(MembershipFunction newMembershipFunction)
Creates a new FuzzySet.

Parameters:
newMembershipFunction - membership function of the fuzzy set
Method Detail

getId

public int getId()
Returns the technical identifier (e.g. within a database).

Returns:
the ID

getMembershipFunction

public final MembershipFunction getMembershipFunction()
Returns the membership function.

Returns:
the membershipFunction property
See Also:
setMembershipFunction(MembershipFunction)

setMembershipFunction

public final void setMembershipFunction(MembershipFunction newMembershipFunction)
Sets the membership function.

Parameters:
newMembershipFunction - The new value for the property.
See Also:
getMembershipFunction()

concentrate

public final void concentrate()
                       throws PropertyVetoException
Concentrates this fuzzy setDegreeOfMembership.

Throws:
PropertyVetoException - when the attempt to set the property is vetoed by a listener

dilate

public final void dilate()
                  throws PropertyVetoException
Dilates this fuzzy setDegreeOfMembership.

Throws:
PropertyVetoException - when the attempt to set the property is vetoed by a listener

getHeight

public final float getHeight()
Returns the height of this fuzzy set.

Returns:
the current height

isConvex

public final boolean isConvex()
Checks whether the membership function is convex. A membership function is convex if there is only one change of sign from + to -.

Returns:
true if membership function is convex false, otherwise

isNormalized

public final boolean isNormalized()
Checks whether the membership function is normalized. A membership function is normalized if its height is 1.0.

Returns:
true if membership function is normalized false, otherwise
See Also:
getHeight()

isValidFuzzyInterval

public final boolean isValidFuzzyInterval()
Checks whether the fuzzy set fulfills the requirements of a fuzzy interval. The membership function has to be convex and normalized. In addition, the maximum has to lie between a closed interval ([a,b] with a != b).

Returns:
true if the membership function would be a fuzzy interval false, otherwise
See Also:
isNormalized(), isConvex()

isValidFuzzyLRInterval

public final boolean isValidFuzzyLRInterval()
Checks whether the fuzzy set fulfills the requirements of a fuzzy LR interval. In addition to the requirements for a fuzzy interval the membership function must be represented by two reference function L and R.

Returns:
true if the fuzzy set would be a fuzzy LR interval false, otherwise
See Also:
isValidFuzzyInterval()

isValidFuzzyLRNumber

public final boolean isValidFuzzyLRNumber()
Checks whether the fuzzy set fulfills the requirements of a fuzzy LR number. In addition to the requirements for a fuzzy number the membership function must be represented by two reference function L and R.

Returns:
true if the fuzzy set would be a fuzzy LR number false, otherwise
See Also:
isValidFuzzyNumber()

isValidFuzzyNumber

public final boolean isValidFuzzyNumber()
Checks whether the fuzzy set fulfills the requirements of a fuzzy number. The membership function has to be convex and normalized. In addition, the maximum is reached at one point.

Returns:
true if the fuzzy set would be a fuzzy number false, otherwise
See Also:
isNormalized(), isConvex()

normalize

public final void normalize()
                     throws PropertyVetoException
Normalizes this fuzzy set.

Throws:
PropertyVetoException - when the attempt to set the property is vetoed by a listener

reciproce

public final void reciproce()
                     throws PropertyVetoException
Computes the reciproce fuzzy set.

Throws:
PropertyVetoException - when the attempt to set the property is vetoed by a listener

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired in response to setting a bound property.

Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - the PropertyChangeListener to be removed

propertyChange

public final void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

clone

public Object clone()
Overrides:
clone in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(boolean withMembershipFunction)
Returns a textual representation of the fuzzy set

Parameters:
withMembershipFunction - true if all points of membership function are also returned, false otherwise.
Returns:
a string representation of the fuzzy set
See Also:
MembershipFunction.toString()


Copyright © 2007-2012 Fuzzy Services. All Rights Reserved.