org.knime.base.node.mine.bfn.fuzzy.membership
Class MembershipFunction

java.lang.Object
  extended by org.knime.base.node.mine.bfn.fuzzy.membership.MembershipFunction
Direct Known Subclasses:
TrapezoidMembershipFunction, TriangleMembershipFunction

public class MembershipFunction
extends Object

Trapezoid membership function with four values for support and core left and right values whereby the support region can be defined infinity. The anchor need to be a value within the core-region. If the anchor's value is changed, the core- and support-region is adjusted if necessary. If the core-region changes, the support-region is - if necessary - adjusted. But not the other way around in both cases.

Author:
Thomas Gabriel, University of Konstanz

Field Summary
(package private) static String MAX_FLAG
          Maximum flag max.
(package private) static String MIN_FLAG
          Minimum flag min.
 
Constructor Summary
MembershipFunction(DoubleValue anchor, MutableDouble min, MutableDouble max)
          Creates a new trapezoid membership function with its given anchor and two values used to assign the min and max border.
MembershipFunction(ModelContentRO pp)
          Creates a new membership function based on the given model content.
 
Method Summary
 DataCell createFuzzyIntervalCell()
          Returns a DataCell, either missing if undefined, or a FuzzyIntervalCell using the membership function properties.
 double getActivation(double value)
          getActivation(.).
 double getAnchor()
           
 double getCenterOfGravity()
           
 double getCore()
           
 MutableDouble getMax()
           
 double getMaxCore()
           
 double getMaxSupport()
           
 MutableDouble getMin()
           
 double getMinCore()
           
 double getMinSupport()
           
 double getSupport()
           
 boolean isMissingIntern()
           
 boolean isSuppLeftMax()
           
 boolean isSuppRightMax()
           
protected  void repairMinMax(double value)
          Minimum and maximum are adapted to the (new) value.
 void resetCore()
          Resets the core to the current anchor.
 void save(ModelContentWO pp)
          Saves this membership function the given model content.
 void setAnchor(double anchor)
          Resets the core and anchor to the given value.
 void setCoreLeft(double value)
          Sets the left core border.
 void setCoreRight(double value)
          Sets the right core border.
 void setSuppLeft(double value)
          Sets the left support border.
 void setSuppRight(double value)
          Sets the right support border.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_FLAG

static final String MIN_FLAG
Minimum flag min.

See Also:
Constant Field Values

MAX_FLAG

static final String MAX_FLAG
Maximum flag max.

See Also:
Constant Field Values
Constructor Detail

MembershipFunction

public MembershipFunction(ModelContentRO pp)
                   throws InvalidSettingsException
Creates a new membership function based on the given model content.

Parameters:
pp - Reads this membership function's properties from.
Throws:
InvalidSettingsException - If the properties can't be read.

MembershipFunction

public MembershipFunction(DoubleValue anchor,
                          MutableDouble min,
                          MutableDouble max)
Creates a new trapezoid membership function with its given anchor and two values used to assign the min and max border.

Parameters:
anchor - the initial center point of this fuzzy function
min - the minimum left border
max - the maximum right border
Method Detail

repairMinMax

protected final void repairMinMax(double value)
Minimum and maximum are adapted to the (new) value.

Parameters:
value - The new value for min and max.

setSuppLeft

public void setSuppLeft(double value)
Sets the left support border.

Parameters:
value - the value to set

resetCore

public void resetCore()
Resets the core to the current anchor.


setAnchor

public void setAnchor(double anchor)
Resets the core and anchor to the given value.

Parameters:
anchor - the new value for the core borders and anchor

setCoreLeft

public void setCoreLeft(double value)
Sets the left core border.

Parameters:
value - to set

setCoreRight

public void setCoreRight(double value)
Sets the right core border.

Parameters:
value - to set

setSuppRight

public void setSuppRight(double value)
Sets the right support border.

Parameters:
value - to set

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string summary for this membership function.

isSuppLeftMax

public boolean isSuppLeftMax()
Returns:
true if left support border is unconstrained otherwise false

getMinSupport

public double getMinSupport()
Returns:
support left border

getMinCore

public double getMinCore()
Returns:
core left border

getAnchor

public double getAnchor()
Returns:
anchor (initial) value of this membership function

getMaxCore

public double getMaxCore()
Returns:
core right border

getMaxSupport

public double getMaxSupport()
Returns:
support right border

isSuppRightMax

public boolean isSuppRightMax()
Returns:
true is right support border is unconstrained otherwise false

getSupport

public double getSupport()
Returns:
suppRight - suppLeft, support spread

getCore

public double getCore()
Returns:
coreRight - coreLeft, core spread

getMin

public final MutableDouble getMin()
Returns:
min of this membership (not min support)

getMax

public final MutableDouble getMax()
Returns:
max of this membership (not max support)

getActivation

public final double getActivation(double value)
getActivation(.).

Parameters:
value - x to apply
Returns:
calculated fuzzy degree in [0.0,1.0] range

getCenterOfGravity

public double getCenterOfGravity()
Returns:
The center of gravity of this trapezoid membership function which are the weighted (by the area) gravities of each of the three areas (left triangle, core rectangle, right triangle) whereby the triangles' gravity point is 2/3 and 1/3 resp. is computed by the product of the gravity point and area for each interval. This value is divided by the overall membership function volume.

isMissingIntern

public final boolean isMissingIntern()
Returns:
true if this membership function is undefined.

createFuzzyIntervalCell

public final DataCell createFuzzyIntervalCell()
Returns a DataCell, either missing if undefined, or a FuzzyIntervalCell using the membership function properties. Internally used to convert this membership function a final DataCell.

Returns:
A data cell for this membership function.

save

public final void save(ModelContentWO pp)
Saves this membership function the given model content.

Parameters:
pp - Model content to save properties to.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.