infosapient.resolution
Class FzyResolutionMethod

java.lang.Object
  |
  +--infosapient.system.ObservableImpl
        |
        +--infosapient.system.FzySystemComponent
              |
              +--infosapient.resolution.FzyResolutionMethod
Direct Known Subclasses:
FzyResAVERAGE_MAXIMUM, FzyResCENTROID, FzyResMAXIMUM, FzyResMAXPLATEAU

public abstract class FzyResolutionMethod
extends FzySystemComponent
implements java.io.Serializable, XMLOutput

FzyResolutionMethod.java

Version:
$Revision: 1.1.1.1 $ FzyResolutionMethod implements the methods required for knowledgebase solution.
See Also:
Serialized Form

Field Summary
protected  double domainValue
           
protected  int edgeCnt
           
private  int[] edges
           
protected  int i
           
protected  int indexForDefuzz
           
protected static int LEFT
           
protected  double mbrValue
           
(package private) static java.lang.String PREFIX
           
protected static int RIGHT
           
(package private) static long serialVersionUID
           
private  FzyKnowledgebase theKB
           
protected  int VECMAX
           
 
Fields inherited from class infosapient.system.FzySystemComponent
DEBUG_, myID, name, pcs, serialVersionUID, trace, vcs
 
Fields inherited from class infosapient.system.ObservableImpl
arr, changed, obs, serialVersionUID
 
Constructor Summary
FzyResolutionMethod()
           
 
Method Summary
protected  java.util.Vector _findPlateau(FzySet fset)
          Return the int array representing the left and right hand side of the plateau in the membership function.
 void applyAlfa(FzySet fset, int type)
           
 FzySet applyHedge(FzySet inputSet, FzyHedge hedge)
          Modifies the shape of a sets surface causing a change in the membership function
 double domainValue()
           
 void domainValue(double sca)
           
 double farEdge(FzySet fset)
          Find the far edge of the plateau
protected  int[] findPlateau(FzySet fset)
          Return the int array representing the left and right hand side of the plateau in the membership function.
 double getDomainForLeftEdge(FzySet fset)
          find the left edge of the specified set.
 double getDomainValue()
          Insert the method's description here.
 int getEdgeCnt()
          Insert the method's description here.
 int[] getEdges()
          Insert the method's description here.
 FzyKnowledgebase getKB()
           
 int getLeftEdge()
          Return the current left edge of set.
 double getMbrValue()
          Insert the method's description here.
 int getRightEdge()
          Return the right edge of the fuzzy set.
 double getScalarUsing(FzySet fset, int inx)
           
protected  void issueWarning(FzySet fset, double height, int pCount)
           
 double monotonicSolution(FzySet fromSet, FzySet toSet, double fromDomValue)
          Calculate a solution for a monotonic space.
 double OR(double truth_1, double truth_2)
          Implements the standard Zadeh OR operator.
 int plateauCount(FzySet fset, double height)
           
 void printOn(java.io.Writer outWriter, int nTabs)
           
static FzyResolutionMethod ResolutionMethodFactory(java.lang.String name)
          Resolution method factory Creation date: (1/26/00 12:17:44 PM)
 double resolveToScalar(FzySet aSet)
          The method to be used for those who wish to defuzzify a given set.
protected abstract  double resolveUsing(FzySet aSet)
          The method used by subclasses of FzyResolutionMethod to defuzzify a given set.
 void setDomainValue(double newDomainValue)
          Insert the method's description here.
 void setEdgeCnt(int newEdgeCnt)
          Insert the method's description here.
 void setEdges(int[] newEdges)
          set the found edges of a set.
 void setKB(FzyKnowledgebase akb)
           
 void setLeftEdge(int l)
          Set the current left edge of set.
 void setMbrValue(double newMbrValue)
          Insert the method's description here.
 void setRightEdge(int r)
          Set the current Right edge of set.
 java.lang.String toString()
           
 java.lang.StringBuffer toXML()
          Represent this resolution method as xml tags.
 java.lang.StringBuffer toXML(int nTabs)
          Represent this resolution method as xml tags.
 
Methods inherited from class infosapient.system.FzySystemComponent
addPropertyChangeListener, addVetoableChangeListener, equals, getID, getName, getPropertyChangeSupport, getVetoableChangeSupport, hashCode, removePropertyChangeListener, removeVetoableChangeListener, setID, setName
 
Methods inherited from class infosapient.system.ObservableImpl
addObserver, clearChanged, containsObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID

PREFIX

static final java.lang.String PREFIX

VECMAX

protected int VECMAX

edges

private int[] edges

theKB

private FzyKnowledgebase theKB

LEFT

protected static final int LEFT

RIGHT

protected static final int RIGHT

edgeCnt

protected int edgeCnt

domainValue

protected double domainValue

mbrValue

protected double mbrValue

indexForDefuzz

protected int indexForDefuzz

i

protected int i
Constructor Detail

FzyResolutionMethod

public FzyResolutionMethod()
Method Detail

_findPlateau

protected java.util.Vector _findPlateau(FzySet fset)
                                 throws FzySystemException
Return the int array representing the left and right hand side of the plateau in the membership function. If the right and left hand indexes are inside the fuzzy set, then this is a double edged plateau. (Edge count = 2)
Parameters:
FzySet -  
Returns:
Vector the plateau locations
Throws:
FzySystemException - - if the membership of this set is zero, or Set index error.

applyAlfa

public void applyAlfa(FzySet fset,
                      int type)

applyHedge

public FzySet applyHedge(FzySet inputSet,
                         FzyHedge hedge)
Modifies the shape of a sets surface causing a change in the membership function
Parameters:
FzySet - the input set
FzyHedge - the FzyHedge to be applied
Returns:
FzySet the fzySet with hedge applied to the membership space.

domainValue

public double domainValue()

domainValue

public void domainValue(double sca)

farEdge

public double farEdge(FzySet fset)
Find the far edge of the plateau
Parameters:
FzySet - - The (solutionset) set containing the plateau to find the edge(s)
Returns:
double - the domain value of the far edge.

findPlateau

protected int[] findPlateau(FzySet fset)
                     throws FzySystemException
Return the int array representing the left and right hand side of the plateau in the membership function. If the right and left hand indexes are inside the fuzzy set, then this is a double edged plateau. (Edge count = 2)
Parameters:
FzySet -  
Returns:
int[]
Throws:
FzySystemException - - if the membership of this set is zero, or Set index error.

getDomainForLeftEdge

public double getDomainForLeftEdge(FzySet fset)
find the left edge of the specified set.
Parameters:
FzySet - - the fuzzy set to be examined for left and right edges.
Returns:
double - the domain value of the near edge.

getDomainValue

public double getDomainValue()
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Returns:
double

getEdgeCnt

public int getEdgeCnt()
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Returns:
int

getEdges

public int[] getEdges()
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Returns:
int[]

getKB

public FzyKnowledgebase getKB()

getLeftEdge

public int getLeftEdge()
Return the current left edge of set. Creation date: (04/16/01 10:33:09 AM)
Returns:
int

getMbrValue

public double getMbrValue()
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Returns:
double

getRightEdge

public int getRightEdge()
Return the right edge of the fuzzy set. Creation date: (04/16/01 10:33:09 AM)
Returns:
int

getScalarUsing

public double getScalarUsing(FzySet fset,
                             int inx)
                      throws java.lang.IllegalArgumentException

issueWarning

protected void issueWarning(FzySet fset,
                            double height,
                            int pCount)

monotonicSolution

public double monotonicSolution(FzySet fromSet,
                                FzySet toSet,
                                double fromDomValue)
                         throws FzySystemException
Calculate a solution for a monotonic space. returns a double representing an output scalar within the toSet.
Parameters:
FzySet - 'fromSet' -- the set the membership value is taken.
FzySet - 'toSet' the set to which the membership value from the first set is to be mapped.
double - the domain value for the 'fromSet'
Returns:
double the solution domain value.

OR

public double OR(double truth_1,
                 double truth_2)
Implements the standard Zadeh OR operator.
Parameters:
double - the membership value_1
double - the membership value_2
Returns:
double the Math.max(value_1, value_2)

plateauCount

public int plateauCount(FzySet fset,
                        double height)

printOn

public void printOn(java.io.Writer outWriter,
                    int nTabs)
             throws java.io.IOException
Overrides:
printOn in class FzySystemComponent

ResolutionMethodFactory

public static FzyResolutionMethod ResolutionMethodFactory(java.lang.String name)
                                                   throws java.lang.IllegalAccessException,
                                                          java.lang.IllegalArgumentException,
                                                          java.lang.InstantiationException,
                                                          java.lang.ClassNotFoundException
Resolution method factory Creation date: (1/26/00 12:17:44 PM)
Parameters:
name - java.lang.String
Returns:
infosapient.resolution.FzyResolutionMethod
Throws:
java.lang.IllegalAccessException -  
java.lang.IllegalArgumentException - If the argument is null.
java.lang.InstantiationException -  
java.lang.ClassNotFoundException -  

resolveToScalar

public double resolveToScalar(FzySet aSet)
The method to be used for those who wish to defuzzify a given set. Performs certain checks for internal consistancy before attempting to defuzzify.
Parameters:
FzySet - the fuzzy set to defuzzify.

resolveUsing

protected abstract double resolveUsing(FzySet aSet)
The method used by subclasses of FzyResolutionMethod to defuzzify a given set.
Parameters:
FzySet - the fuzzy set to defuzzify.

setDomainValue

public void setDomainValue(double newDomainValue)
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Parameters:
newDomainValue - double

setEdgeCnt

public void setEdgeCnt(int newEdgeCnt)
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Parameters:
newEdgeCnt - int

setEdges

public void setEdges(int[] newEdges)
set the found edges of a set. Creation date: (04/16/01 10:32:22 AM)
Parameters:
newEdges - int[]

setKB

public void setKB(FzyKnowledgebase akb)

setLeftEdge

public void setLeftEdge(int l)
Set the current left edge of set. Creation date: (04/16/01 10:33:09 AM)
Returns:
int

setMbrValue

public void setMbrValue(double newMbrValue)
Insert the method's description here. Creation date: (04/16/01 10:32:22 AM)
Parameters:
newMbrValue - double

setRightEdge

public void setRightEdge(int r)
Set the current Right edge of set. Creation date: (04/16/01 10:33:09 AM)
Returns:
int

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXML

public java.lang.StringBuffer toXML()
Represent this resolution method as xml tags. Creation date: (1/31/00 8:47:14 AM)
Returns:
java.lang.StringBuffer

toXML

public java.lang.StringBuffer toXML(int nTabs)
Represent this resolution method as xml tags. Creation date: (1/31/00 8:47:14 AM)
Specified by:
toXML in interface XMLOutput
Returns:
java.lang.StringBuffer

License to use this program is provided under the TERMS OF THE COMMON PUBLIC LICENSE 0.5. ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved